Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #125689

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ac59bdc
Add `--print=check-cfg` to get the expected configs
Urgau Apr 22, 2024
8693064
miri: avoid making a full copy of all new allocations
RalfJung May 27, 2024
d9d013b
rewrite lto-smoke to rmake
Oneirical May 28, 2024
634270e
rewrite mixing-deps in rmake
Oneirical May 28, 2024
b119e42
Add run-make-support to x doc
ChrisDenton May 28, 2024
ef9e6ca
Fix run-make-support doc errors
ChrisDenton May 28, 2024
d82be82
Enable a few tests on macOS
madsmtm May 27, 2024
37ae2b6
Disable stack overflow handler tests on iOS-like platforms
madsmtm May 16, 2024
e6b9bb7
Make more of the test suite run on Mac Catalyst
madsmtm May 27, 2024
37c54db
Silence some resolve errors when there have been glob import errors
estebank May 21, 2024
89f3651
Get rid of manual Trace calls
compiler-errors May 28, 2024
cc97376
Rewrite simple-rlib to rmake
Oneirical May 28, 2024
2bd5050
Remove Trace
compiler-errors May 28, 2024
459ce3f
Add an intrinsic for `ptr::metadata`
scottmcm Apr 21, 2024
7150839
Add custom mir support for `PtrMetadata`
scottmcm May 25, 2024
5a8c1f3
Add Miri tests for `PtrMetadata` UB
scottmcm May 26, 2024
57948c8
Add Miri smoke pass test for ptr_metadata intrinsic
scottmcm May 27, 2024
7c82b4d
Rollup merge of #124251 - scottmcm:unop-ptr-metadata, r=oli-obk
jieyouxu May 28, 2024
ddcc5bd
Rollup merge of #124320 - Urgau:print-check-cfg, r=petrochenkov
jieyouxu May 28, 2024
c7b4ddd
Rollup merge of #125226 - madsmtm:fix-mac-catalyst-tests, r=workingju…
jieyouxu May 28, 2024
7c4faa0
Rollup merge of #125381 - estebank:issue-96799, r=petrochenkov
jieyouxu May 28, 2024
dcd5d7e
Rollup merge of #125633 - RalfJung:miri-no-copy, r=saethlin
jieyouxu May 28, 2024
0425153
Rollup merge of #125638 - Oneirical:lets-find-some-tests, r=jieyouxu
jieyouxu May 28, 2024
2fcf99c
Rollup merge of #125639 - ChrisDenton:run-make-support-doc, r=onur-ozkan
jieyouxu May 28, 2024
093791c
Rollup merge of #125664 - compiler-errors:trace-tweaks, r=lcnr
jieyouxu May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ fn metadata_access_times() {
assert_eq!(check!(a.modified()), check!(a.modified()));
assert_eq!(check!(b.accessed()), check!(b.modified()));

if cfg!(target_os = "macos") || cfg!(target_os = "windows") {
if cfg!(target_vendor = "apple") || cfg!(target_os = "windows") {
check!(a.created());
check!(b.created());
}
Expand Down
8 changes: 8 additions & 0 deletions library/std/src/sys/pal/unix/stack_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ mod imp {
}
}

// This is intentionally not enabled on iOS/tvOS/watchOS/visionOS, as it uses
// several symbols that might lead to rejections from the App Store, namely
// `sigaction`, `sigaltstack`, `sysctlbyname`, `mmap`, `munmap` and `mprotect`.
//
// This might be overly cautious, though it is also what Swift does (and they
// usually have fewer qualms about forwards compatibility, since the runtime
// is shipped with the OS):
// <https://github.com/apple/swift/blob/swift-5.10-RELEASE/stdlib/public/runtime/CrashHandlerMacOS.cpp>
#[cfg(not(any(
target_os = "linux",
target_os = "freebsd",
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/utils/dylib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pub fn dylib_path_var() -> &'static str {
if cfg!(target_os = "windows") {
"PATH"
} else if cfg!(target_os = "macos") {
} else if cfg!(target_vendor = "apple") {
"DYLD_LIBRARY_PATH"
} else if cfg!(target_os = "haiku") {
"LIBRARY_PATH"
Expand Down
3 changes: 2 additions & 1 deletion src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"ignore-aarch64",
"ignore-aarch64-unknown-linux-gnu",
"ignore-android",
"ignore-apple",
"ignore-arm",
"ignore-avr",
"ignore-beta",
Expand Down Expand Up @@ -829,7 +830,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"ignore-x32",
"ignore-x86",
"ignore-x86_64",
"ignore-x86_64-apple-darwin",
"ignore-x86_64-unknown-linux-gnu",
"incremental",
"known-bug",
Expand Down Expand Up @@ -876,6 +876,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"only-32bit",
"only-64bit",
"only-aarch64",
"only-apple",
"only-arm",
"only-avr",
"only-beta",
Expand Down
6 changes: 6 additions & 0 deletions src/tools/compiletest/src/header/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ pub(super) fn parse_cfg_name_directive<'a>(
message: "when the architecture is part of the Thumb family"
}

condition! {
name: "apple",
condition: config.target.contains("apple"),
message: "when the target vendor is Apple"
}

// Technically the locally built compiler uses the "dev" channel rather than the "nightly"
// channel, even though most people don't know or won't care about it. To avoid confusion, we
// treat the "dev" channel as the "nightly" channel when processing the directive.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn get_lib_name(lib: &str, aux_type: AuxType) -> Option<String> {
AuxType::Lib => Some(format!("lib{}.rlib", lib)),
AuxType::Dylib => Some(if cfg!(windows) {
format!("{}.dll", lib)
} else if cfg!(target_os = "macos") {
} else if cfg!(target_vendor = "apple") {
format!("lib{}.dylib", lib)
} else {
format!("lib{}.so", lib)
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl PathBufExt for PathBuf {
pub fn dylib_env_var() -> &'static str {
if cfg!(windows) {
"PATH"
} else if cfg!(target_os = "macos") {
} else if cfg!(target_vendor = "apple") {
"DYLD_LIBRARY_PATH"
} else if cfg!(target_os = "haiku") {
"LIBRARY_PATH"
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,6 @@ ui/issues/issue-33687.rs
ui/issues/issue-33770.rs
ui/issues/issue-3389.rs
ui/issues/issue-33941.rs
ui/issues/issue-33992.rs
ui/issues/issue-34047.rs
ui/issues/issue-34074.rs
ui/issues/issue-34209.rs
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
const ENTRY_LIMIT: u32 = 900;
// FIXME: The following limits should be reduced eventually.

const ISSUES_ENTRY_LIMIT: u32 = 1676;
const ISSUES_ENTRY_LIMIT: u32 = 1674;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ revisions: all strong basic none missing
//@ assembly-output: emit-asm
//@ ignore-macos slightly different policy on stack protection of arrays
//@ ignore-apple slightly different policy on stack protection of arrays
//@ ignore-msvc stack check code uses different function names
//@ ignore-nvptx64 stack protector is not supported
//@ ignore-wasm32-bare
Expand All @@ -17,12 +17,9 @@
// See comments on https://github.com/rust-lang/rust/issues/114903.

#![crate_type = "lib"]

#![allow(incomplete_features)]

#![feature(unsized_locals, unsized_fn_params)]


// CHECK-LABEL: emptyfn:
#[no_mangle]
pub fn emptyfn() {
Expand Down
2 changes: 1 addition & 1 deletion tests/assembly/x86_64-array-pair-load-store-merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
//@ only-x86_64
//@ ignore-sgx
//@ ignore-macos (manipulates rsp too)
//@ ignore-apple (manipulates rsp too)

// Depending on various codegen choices, this might end up copying
// a `<2 x i8>`, an `i16`, or two `i8`s.
Expand Down
2 changes: 1 addition & 1 deletion tests/assembly/x86_64-function-return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//@ [keep-thunk-extern] compile-flags: -Zfunction-return=keep -Zfunction-return=thunk-extern
//@ [thunk-extern-keep] compile-flags: -Zfunction-return=thunk-extern -Zfunction-return=keep
//@ only-x86_64
//@ ignore-x86_64-apple-darwin Symbol is called `___x86_return_thunk` (Darwin's extra underscore)
//@ ignore-apple Symbol is called `___x86_return_thunk` (Darwin's extra underscore)
//@ ignore-sgx Tests incompatible with LVI mitigations

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/gdb_debug_script_load.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
//@ ignore-windows
//@ ignore-macos
//@ ignore-apple
//@ ignore-wasm
//@ ignore-emscripten

Expand Down
4 changes: 2 additions & 2 deletions tests/codegen/instrument-coverage/testprog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//@ [LINUX] filecheck-flags: -DINSTR_PROF_COVFUN=__llvm_covfun
//@ [LINUX] filecheck-flags: '-DCOMDAT_IF_SUPPORTED=, comdat'

//@ [DARWIN] only-macos
//@ [DARWIN] only-apple
//@ [DARWIN] filecheck-flags: -DINSTR_PROF_DATA=__DATA,__llvm_prf_data,regular,live_support
//@ [DARWIN] filecheck-flags: -DINSTR_PROF_NAME=__DATA,__llvm_prf_names
//@ [DARWIN] filecheck-flags: -DINSTR_PROF_CNTS=__DATA,__llvm_prf_cnts
Expand Down Expand Up @@ -49,7 +49,7 @@ where

pub fn wrap_with<F, T>(inner: T, should_wrap: bool, wrapper: F)
where
F: FnOnce(&T)
F: FnOnce(&T),
{
if should_wrap {
wrapper(&inner)
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/issues/issue-44056-macos-tls-align.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
//@ only-macos
//@ only-apple
//@ compile-flags: -O

#![crate_type = "rlib"]
Expand Down
5 changes: 2 additions & 3 deletions tests/codegen/mainsubprogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
// before 4.0, formerly backported to the Rust LLVM fork.

//@ ignore-windows
//@ ignore-macos
//@ ignore-apple
//@ ignore-wasi

//@ compile-flags: -g -C no-prepopulate-passes

// CHECK-LABEL: @main
// CHECK: {{.*}}DISubprogram{{.*}}name: "main",{{.*}}DI{{(SP)?}}FlagMainSubprogram{{.*}}

pub fn main() {
}
pub fn main() {}
2 changes: 1 addition & 1 deletion tests/codegen/mainsubprogramstart.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ ignore-windows
//@ ignore-macos
//@ ignore-apple
//@ ignore-wasi wasi codegens the main symbol differently

//@ compile-flags: -g -C no-prepopulate-passes
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/pgo-counter-bias.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Test that __llvm_profile_counter_bias does not get internalized by lto.

//@ ignore-macos -runtime-counter-relocation not honored on Mach-O
//@ ignore-apple -runtime-counter-relocation not honored on Mach-O
//@ compile-flags: -Cprofile-generate -Cllvm-args=-runtime-counter-relocation -Clto=fat
//@ needs-profiler-support
//@ no-prefer-dynamic
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/c-dynamic-dylib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ignore-cross-compile
include ../tools.mk

# ignore-macos
# ignore-apple
#
# This hits an assertion in the linker on older versions of osx apparently

Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/c-dynamic-rlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ignore-cross-compile
include ../tools.mk

# ignore-macos
# ignore-apple
#
# This hits an assertion in the linker on older versions of osx apparently

Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/emit-stack-sizes/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include ../tools.mk

# ignore-windows
# ignore-macos
# ignore-apple
#
# This feature only works when the output object format is ELF so we ignore
# macOS and Windows
# Apple and Windows

# check that the .stack_sizes section is generated
all:
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/fpic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
include ../tools.mk

# ignore-windows
# ignore-macos
# ignore-apple

# Test for #39529.
# `-z text` causes ld to error if there are any non-PIC sections
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/link-framework/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# only-macos
# only-apple
#
# Check that linking to a framework actually makes it to the linker.

Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/macos-fat-archive/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# only-macos
# only-apple

include ../tools.mk

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ignore-cross-compile
# ignore-macos
# ignore-apple

include ../tools.mk

Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/used-cdylib-macos/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include ../tools.mk

# only-macos
# only-apple
#
# This checks that `#[used]` passes through to the linker on
# darwin. This is subject to change in the future, see
# Apple targets. This is subject to change in the future, see
# https://github.com/rust-lang/rust/pull/93718 for discussion

all:
Expand Down
5 changes: 2 additions & 3 deletions tests/run-pass-valgrind/exit-flushes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ ignore-wasm32 no subprocess support
//@ ignore-sgx no processes
//@ ignore-macos this needs valgrind 3.11 or higher; see
//@ ignore-apple this needs valgrind 3.11 or higher; see
// https://github.com/rust-lang/rust/pull/30365#issuecomment-165763679

use std::env;
Expand All @@ -11,8 +11,7 @@ fn main() {
print!("hello!");
exit(0);
} else {
let out = Command::new(env::args().next().unwrap()).arg("foo")
.output().unwrap();
let out = Command::new(env::args().next().unwrap()).arg("foo").output().unwrap();
assert!(out.status.success());
assert_eq!(String::from_utf8(out.stdout).unwrap(), "hello!");
assert_eq!(String::from_utf8(out.stderr).unwrap(), "");
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/abi/stack-probes-lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
//@ compile-flags: -C lto
//@ no-prefer-dynamic
//@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino
//@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't

include!("stack-probes.rs");
4 changes: 4 additions & 0 deletions tests/ui/abi/stack-probes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
//@ ignore-sgx no processes
//@ ignore-fuchsia no exception handler registered for segfault
//@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino
//@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't
//@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't

use std::env;
use std::mem::MaybeUninit;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/backtrace/apple-no-dsymutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//@ compile-flags:-Cstrip=none
//@ compile-flags:-g -Csplit-debuginfo=unpacked
//@ only-macos
//@ only-apple

use std::process::Command;
use std::str;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/deployment-target/macos-target.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ only-macos
//@ only-apple
//@ compile-flags: --print deployment-target
//@ normalize-stdout-test: "\d+\." -> "$$CURRENT_MAJOR_VERSION."
//@ normalize-stdout-test: "\d+" -> "$$CURRENT_MINOR_VERSION"
Expand Down
29 changes: 15 additions & 14 deletions tests/ui/intrinsics/intrinsic-alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ mod rusti {
}
}

#[cfg(any(target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "solaris",
target_os = "vxworks",
target_os = "nto",
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "hurd",
target_os = "illumos",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd",
target_os = "solaris",
target_os = "vxworks",
target_os = "nto",
target_vendor = "apple",
))]
mod m {
#[cfg(target_arch = "x86")]
Expand Down
13 changes: 9 additions & 4 deletions tests/ui/issues/issue-45731.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
#![allow(unused_variables)]
//@ compile-flags:--test -g

#[cfg(target_os = "macos")]
#[cfg(target_vendor = "apple")]
#[test]
fn simple_test() {
use std::{env, panic, fs};
use std::{env, fs, panic};

// Find our dSYM and replace the DWARF binary with an empty file
let mut dsym_path = env::current_exe().unwrap();
let executable_name = dsym_path.file_name().unwrap().to_str().unwrap().to_string();
assert!(dsym_path.pop()); // Pop executable
dsym_path.push(format!("{}.dSYM/Contents/Resources/DWARF/{0}", executable_name));
{
let file = fs::OpenOptions::new().read(false).write(true).truncate(true).create(false)
.open(&dsym_path).unwrap();
let file = fs::OpenOptions::new()
.read(false)
.write(true)
.truncate(true)
.create(false)
.open(&dsym_path)
.unwrap();
}

env::set_var("RUST_BACKTRACE", "1");
Expand Down
Loading