diff --git a/compiler/rustc_abi/src/callconv.rs b/compiler/rustc_abi/src/callconv.rs index d6594e277f00c..41e87caf40c7d 100644 --- a/compiler/rustc_abi/src/callconv.rs +++ b/compiler/rustc_abi/src/callconv.rs @@ -35,6 +35,7 @@ impl HomogeneousAggregate { /// Try to combine two `HomogeneousAggregate`s, e.g. from two fields in /// the same `struct`. Only succeeds if only one of them has any data, /// or both units are identical. + #[cfg(feature = "nightly")] fn merge(self, other: HomogeneousAggregate) -> Result { match (self, other) { (x, HomogeneousAggregate::NoData) | (HomogeneousAggregate::NoData, x) => Ok(x), diff --git a/compiler/rustc_codegen_llvm/src/va_arg.rs b/compiler/rustc_codegen_llvm/src/va_arg.rs index be1733086c837..3cd4e490fd5ba 100644 --- a/compiler/rustc_codegen_llvm/src/va_arg.rs +++ b/compiler/rustc_codegen_llvm/src/va_arg.rs @@ -1171,14 +1171,29 @@ pub(super) fn emit_va_arg<'ll, 'tcx>( AllowHigherAlign::Yes, ForceRightAdjust::No, ), + Arch::Mips | Arch::Mips32r6 | Arch::Mips64 | Arch::Mips64r6 => emit_ptr_va_arg( + bx, + addr, + target_ty, + PassMode::Direct, + match &target.llvm_abiname { + LlvmAbi::N32 | LlvmAbi::N64 => SlotSize::Bytes8, + LlvmAbi::O32 => SlotSize::Bytes4, + other => bug!("unexpected LLVM ABI {other}"), + }, + AllowHigherAlign::Yes, + // In big-endian mode the actual value is stored in the right side of the slot, meaning + // that when the value is smaller than a slot, we need to adjust the pointer we read + // to somewhere in the middle of the slot. + match bx.tcx().sess.target.endian { + Endian::Big => ForceRightAdjust::Yes, + Endian::Little => ForceRightAdjust::No, + }, + ), Arch::Bpf => bug!("bpf does not support c-variadic functions"), Arch::SpirV => bug!("spirv does not support c-variadic functions"), - Arch::Mips | Arch::Mips32r6 | Arch::Mips64 | Arch::Mips64r6 => { - // FIXME: port MipsTargetLowering::lowerVAARG. - bx.va_arg(addr.immediate(), bx.cx.layout_of(target_ty).llvm_type(bx.cx)) - } Arch::Sparc | Arch::Avr | Arch::M68k | Arch::Msp430 => { // Clang uses the LLVM implementation for these architectures. bx.va_arg(addr.immediate(), bx.cx.layout_of(target_ty).llvm_type(bx.cx)) diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs index 2c5668e22f389..98bda252b2e75 100644 --- a/compiler/rustc_index/src/bit_set.rs +++ b/compiler/rustc_index/src/bit_set.rs @@ -1,6 +1,4 @@ use std::marker::PhantomData; -#[cfg(not(feature = "nightly"))] -use std::mem; use std::ops::{Bound, Range, RangeBounds}; use std::rc::Rc; use std::{fmt, iter, slice}; diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index b4f6bb4583c10..726f05e36ac9f 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -165,10 +165,17 @@ static OptimizationLevel fromRust(LLVMRustPassBuilderOptLevel Level) { return OptimizationLevel::O2; case LLVMRustPassBuilderOptLevel::O3: return OptimizationLevel::O3; +#if LLVM_VERSION_GE(23, 0) + case LLVMRustPassBuilderOptLevel::Os: + return OptimizationLevel::O2; + case LLVMRustPassBuilderOptLevel::Oz: + return OptimizationLevel::O2; +#else case LLVMRustPassBuilderOptLevel::Os: return OptimizationLevel::Os; case LLVMRustPassBuilderOptLevel::Oz: return OptimizationLevel::Oz; +#endif default: report_fatal_error("Bad PassBuilderOptLevel."); } diff --git a/compiler/rustc_mir_transform/src/unreachable_enum_branching.rs b/compiler/rustc_mir_transform/src/unreachable_enum_branching.rs index 6ccec5b6f2129..3cdfe92023bb7 100644 --- a/compiler/rustc_mir_transform/src/unreachable_enum_branching.rs +++ b/compiler/rustc_mir_transform/src/unreachable_enum_branching.rs @@ -4,8 +4,7 @@ use rustc_abi::Variants; use rustc_data_structures::fx::FxHashSet; use rustc_middle::bug; use rustc_middle::mir::{ - BasicBlock, BasicBlockData, BasicBlocks, Body, Local, Operand, Rvalue, StatementKind, - TerminatorKind, + BasicBlockData, Body, Local, Operand, Rvalue, StatementKind, TerminatorKind, }; use rustc_middle::ty::layout::TyAndLayout; use rustc_middle::ty::{Ty, TyCtxt}; @@ -125,43 +124,10 @@ impl<'tcx> crate::MirPass<'tcx> for UnreachableEnumBranching { unreachable_targets.push(index); } } - let otherwise_is_empty_unreachable = - body.basic_blocks[targets.otherwise()].is_empty_unreachable(); - fn check_successors(basic_blocks: &BasicBlocks<'_>, bb: BasicBlock) -> bool { - // After resolving https://github.com/llvm/llvm-project/issues/78578, - // We can remove this check. - // The main issue here is that `early-tailduplication` causes compile time overhead - // and potential performance problems. - // Simply put, when encounter a switch (indirect branch) statement, - // `early-tailduplication` tries to duplicate the switch branch statement with BB - // into (each) predecessors. This makes CFG very complex. - // We can understand it as it transforms the following code - // ```rust - // match a { ... many cases }; - // match b { ... many cases }; - // ``` - // into - // ```rust - // match a { ... many match b { goto BB cases } } - // ... BB cases - // ``` - // Abandon this transformation when it is possible (the best effort) - // to encounter the problem. - let mut successors = basic_blocks[bb].terminator().successors(); - let Some(first_successor) = successors.next() else { return true }; - if successors.next().is_some() { - return true; - } - if let TerminatorKind::SwitchInt { .. } = - &basic_blocks[first_successor].terminator().kind - { - return false; - }; - true - } + // If and only if there is a variant that does not have a branch set, change the // current of otherwise as the variant branch and set otherwise to unreachable. It - // transforms following code + // transforms the following code // ```rust // match c { // Ordering::Less => 1, @@ -177,15 +143,8 @@ impl<'tcx> crate::MirPass<'tcx> for UnreachableEnumBranching { // Ordering::Greater => 3, // } // ``` - let otherwise_is_last_variant = !otherwise_is_empty_unreachable - && allowed_variants.len() == 1 - // Despite the LLVM issue, we hope that small enum can still be transformed. - // This is valuable for both `a <= b` and `if let Some/Ok(v)`. - && (targets.all_targets().len() <= 3 - || check_successors(&body.basic_blocks, targets.otherwise())); - let replace_otherwise_to_unreachable = otherwise_is_last_variant - || (!otherwise_is_empty_unreachable && allowed_variants.is_empty()); - + let replace_otherwise_to_unreachable = allowed_variants.len() <= 1 + && !body.basic_blocks[targets.otherwise()].is_empty_unreachable(); if unreachable_targets.is_empty() && !replace_otherwise_to_unreachable { continue; } @@ -193,6 +152,7 @@ impl<'tcx> crate::MirPass<'tcx> for UnreachableEnumBranching { let unreachable_block = patch.unreachable_no_cleanup_block(); let mut targets = targets.clone(); if replace_otherwise_to_unreachable { + let otherwise_is_last_variant = allowed_variants.len() == 1; if otherwise_is_last_variant { // We have checked that `allowed_variants` has only one element. #[allow(rustc::potential_query_instability)] diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs index 9121e38021712..078658db4fedc 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs @@ -606,6 +606,10 @@ impl Trait for X { ty: Ty<'tcx>, ) -> bool { let tcx = self.tcx; + // FIXME(inherent_associated_types): Extend this to support `ty::Inherent`, too. + if !matches!(proj_ty.kind, ty::AliasTyKind::Projection { .. }) { + return false; + } let Some(body_owner_def_id) = body_owner_def_id else { return false; }; diff --git a/library/core/src/ffi/va_list.rs b/library/core/src/ffi/va_list.rs index ca211fca15518..020ea4513078d 100644 --- a/library/core/src/ffi/va_list.rs +++ b/library/core/src/ffi/va_list.rs @@ -204,7 +204,7 @@ crate::cfg_select! { /// unsafe fn vmy_func(count: u32, mut ap: VaList<'_>) -> i32 { /// let mut sum = 0; /// for _ in 0..count { -/// sum += unsafe { ap.arg::() }; +/// sum += unsafe { ap.next_arg::() }; /// } /// sum /// } @@ -213,7 +213,7 @@ crate::cfg_select! { /// assert_eq!(unsafe { my_func(3, 42i32, -7i32, 20i32) }, 55); /// ``` /// -/// The [`VaList::arg`] method reads the next argument from the variable argument list, +/// The [`VaList::next_arg`] method reads the next argument from the variable argument list, /// and is equivalent to C `va_arg`. /// /// Cloning a `VaList` performs the equivalent of C `va_copy`, producing an independent cursor @@ -284,7 +284,7 @@ mod sealed { impl Sealed for *const T {} } -/// Types that are valid to read using [`VaList::arg`]. +/// Types that are valid to read using [`VaList::next_arg`]. /// /// This trait is implemented for primitive types that have a variable argument application-binary /// interface (ABI) on the current platform. It is always implemented for: @@ -391,7 +391,7 @@ impl<'f> VaList<'f> { /// are no more variable arguments, is unsound. #[inline] // Avoid codegen when not used to help backends that don't support VaList. #[rustc_const_unstable(feature = "const_c_variadic", issue = "151787")] - pub const unsafe fn arg(&mut self) -> T { + pub const unsafe fn next_arg(&mut self) -> T { // SAFETY: the caller must uphold the safety contract for `va_arg`. unsafe { va_arg(self) } } diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md index 76bf2cdbea667..d536d324cb2bf 100644 --- a/src/doc/rustc-dev-guide/src/tests/directives.md +++ b/src/doc/rustc-dev-guide/src/tests/directives.md @@ -326,6 +326,8 @@ See [Pretty-printer](compiletest.md#pretty-printer-tests). The following directives affect how certain command-line tools are invoked, in test suites that use those tools: +- `skip-filecheck` avoids running LLVM's `FileCheck` tool in tests that would normally run it to check output. + - Used by codegen tests, assembly tests, and mir-opt tests. - `filecheck-flags` adds extra flags when running LLVM's `FileCheck` tool. - Used by [codegen tests](compiletest.md#codegen-tests), [assembly tests](compiletest.md#assembly-tests), and diff --git a/src/doc/unstable-book/src/language-features/c-variadic.md b/src/doc/unstable-book/src/language-features/c-variadic.md index 001c1bfa9ec03..72980ea91ba28 100644 --- a/src/doc/unstable-book/src/language-features/c-variadic.md +++ b/src/doc/unstable-book/src/language-features/c-variadic.md @@ -17,7 +17,7 @@ defined in Rust. They may be called both from within Rust and via FFI. pub unsafe extern "C" fn add(n: usize, mut args: ...) -> usize { let mut sum = 0; for _ in 0..n { - sum += args.arg::(); + sum += args.next_arg::(); } sum } diff --git a/src/tools/compiletest/src/directives.rs b/src/tools/compiletest/src/directives.rs index 44765c906c991..d87cb915b07b8 100644 --- a/src/tools/compiletest/src/directives.rs +++ b/src/tools/compiletest/src/directives.rs @@ -195,6 +195,9 @@ pub(crate) struct TestProps { /// Extra flags to pass to `llvm-cov` when producing coverage reports. /// Only used by the "coverage-run" test mode. pub(crate) llvm_cov_flags: Vec, + /// Don't run LLVM's `filecheck` tool to check compiler output, + /// in tests that would normally run it. + pub(crate) skip_filecheck: bool, /// Extra flags to pass to LLVM's `filecheck` tool, in tests that use it. pub(crate) filecheck_flags: Vec, /// Don't automatically insert any `--check-cfg` args @@ -308,6 +311,7 @@ impl TestProps { mir_unit_test: None, remap_src_base: false, llvm_cov_flags: vec![], + skip_filecheck: false, filecheck_flags: vec![], no_auto_check_cfg: false, add_minicore: false, @@ -438,7 +442,6 @@ impl TestProps { let check_no_run = |s| match (config.mode, s) { (TestMode::Ui, _) => (), (TestMode::Crashes, _) => (), - (TestMode::Codegen, "build-pass") => (), (mode, _) => panic!("`{s}` directive is not supported in `{mode}` tests"), }; let pass_mode = if config.parse_name_directive(ln, "check-pass") { diff --git a/src/tools/compiletest/src/directives/directive_names.rs b/src/tools/compiletest/src/directives/directive_names.rs index 34c6c1374b632..0d06f6e75af7c 100644 --- a/src/tools/compiletest/src/directives/directive_names.rs +++ b/src/tools/compiletest/src/directives/directive_names.rs @@ -286,6 +286,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "rustc-env", "rustfix-only-machine-applicable", "should-fail", + "skip-filecheck", "stderr-per-bitwidth", "test-mir-pass", "unique-doc-out-dir", diff --git a/src/tools/compiletest/src/directives/handlers.rs b/src/tools/compiletest/src/directives/handlers.rs index 5e6d2d49d7dcf..a1d6bd3088239 100644 --- a/src/tools/compiletest/src/directives/handlers.rs +++ b/src/tools/compiletest/src/directives/handlers.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use std::sync::{Arc, LazyLock}; -use crate::common::Config; +use crate::common::{Config, TestMode}; use crate::directives::{ DirectiveLine, NormalizeKind, NormalizeRule, TestProps, parse_and_update_aux, parse_edition_range, split_flags, @@ -312,6 +312,18 @@ fn make_directive_handlers_map() -> HashMap<&'static str, Handler> { props.llvm_cov_flags.extend(split_flags(&flags)); } }), + handler("skip-filecheck", |config, ln, props| { + let directive_name = ln.name; + // FIXME(Zalathar): Someday we should add unified support for declaring + // and checking which modes are supported by each directive. + if !matches!(config.mode, TestMode::Assembly | TestMode::Codegen | TestMode::MirOpt) { + panic!( + "directive `//@ {directive_name}` is not supported by this test suite (mode: {mode:?})", + mode = config.mode + ); + } + config.set_name_directive(ln, directive_name, &mut props.skip_filecheck); + }), handler(FILECHECK_FLAGS, |config, ln, props| { if let Some(flags) = config.parse_name_value_directive(ln, FILECHECK_FLAGS) { props.filecheck_flags.extend(split_flags(&flags)); diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 8a7c34d212223..568e307366641 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -295,14 +295,9 @@ impl<'test> TestCx<'test> { fn should_run(&self, pm: Option) -> WillExecute { let test_should_run = match self.config.mode { - TestMode::Ui - if pm == Some(PassMode::Run) - || matches!(self.props.fail_mode, Some(FailMode::Run(_))) => - { - true + TestMode::Ui => { + pm == Some(PassMode::Run) || matches!(self.props.fail_mode, Some(FailMode::Run(_))) } - TestMode::MirOpt if pm == Some(PassMode::Run) => true, - TestMode::Ui | TestMode::MirOpt => false, mode => panic!("unimplemented for mode {:?}", mode), }; if test_should_run { self.run_if_enabled() } else { WillExecute::No } @@ -314,7 +309,7 @@ impl<'test> TestCx<'test> { fn should_run_successfully(&self, pm: Option) -> bool { match self.config.mode { - TestMode::Ui | TestMode::MirOpt => pm == Some(PassMode::Run), + TestMode::Ui => pm == Some(PassMode::Run), mode => panic!("unimplemented for mode {:?}", mode), } } @@ -935,23 +930,13 @@ impl<'test> TestCx<'test> { } fn compile_test(&self, will_execute: WillExecute, emit: Emit) -> ProcRes { - self.compile_test_general(will_execute, emit, self.props.local_pass_mode(), Vec::new()) - } - - fn compile_test_with_passes( - &self, - will_execute: WillExecute, - emit: Emit, - passes: Vec, - ) -> ProcRes { - self.compile_test_general(will_execute, emit, self.props.local_pass_mode(), passes) + self.compile_test_general(will_execute, emit, Vec::new()) } fn compile_test_general( &self, will_execute: WillExecute, emit: Emit, - local_pm: Option, passes: Vec, ) -> ProcRes { let compiler_kind = self.compiler_kind_for_non_aux(); @@ -975,7 +960,7 @@ impl<'test> TestCx<'test> { // Note that we use the local pass mode here as we don't want // to set unused to allow if we've overridden the pass mode // via command line flags. - && local_pm != Some(PassMode::Run) + && self.props.local_pass_mode() != Some(PassMode::Run) { AllowUnused::Yes } else { diff --git a/src/tools/compiletest/src/runtest/assembly.rs b/src/tools/compiletest/src/runtest/assembly.rs index 18027328abfe0..0d41c29075c43 100644 --- a/src/tools/compiletest/src/runtest/assembly.rs +++ b/src/tools/compiletest/src/runtest/assembly.rs @@ -13,9 +13,11 @@ impl TestCx<'_> { self.fatal_proc_rec("compilation failed!", &proc_res); } - let proc_res = self.verify_with_filecheck(&output_path); - if !proc_res.status.success() { - self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + if !self.props.skip_filecheck { + let proc_res = self.verify_with_filecheck(&output_path); + if !proc_res.status.success() { + self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + } } } diff --git a/src/tools/compiletest/src/runtest/codegen.rs b/src/tools/compiletest/src/runtest/codegen.rs index 6e61ab5e46d66..60da1ff40f17d 100644 --- a/src/tools/compiletest/src/runtest/codegen.rs +++ b/src/tools/compiletest/src/runtest/codegen.rs @@ -1,4 +1,4 @@ -use super::{PassMode, TestCx}; +use super::TestCx; impl TestCx<'_> { pub(super) fn run_codegen_test(&self) { @@ -11,12 +11,11 @@ impl TestCx<'_> { self.fatal_proc_rec("compilation failed!", &proc_res); } - if let Some(PassMode::Build) = self.pass_mode() { - return; - } - let proc_res = self.verify_with_filecheck(&output_path); - if !proc_res.status.success() { - self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + if !self.props.skip_filecheck { + let proc_res = self.verify_with_filecheck(&output_path); + if !proc_res.status.success() { + self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res); + } } } } diff --git a/src/tools/compiletest/src/runtest/mir_opt.rs b/src/tools/compiletest/src/runtest/mir_opt.rs index 9448792638346..f152e7973398a 100644 --- a/src/tools/compiletest/src/runtest/mir_opt.rs +++ b/src/tools/compiletest/src/runtest/mir_opt.rs @@ -10,9 +10,6 @@ use crate::runtest::compute_diff::write_diff; impl TestCx<'_> { pub(super) fn run_mir_opt_test(&self) { - let pm = self.pass_mode(); - let should_run = self.should_run(pm); - let mut test_info = files_for_miropt_test( &self.testpaths.file.as_std_path(), self.config.get_pointer_width(), @@ -21,26 +18,18 @@ impl TestCx<'_> { let passes = std::mem::take(&mut test_info.passes); - let proc_res = self.compile_test_with_passes(should_run, Emit::Mir, passes); + let proc_res = self.compile_test_general(WillExecute::No, Emit::Mir, passes); if !proc_res.status.success() { self.fatal_proc_rec("compilation failed!", &proc_res); } self.check_mir_dump(test_info); - - if let WillExecute::Yes = should_run { - let proc_res = self.exec_compiled_test(); - - if !proc_res.status.success() { - self.fatal_proc_rec("test run failed!", &proc_res); - } - } } fn check_mir_dump(&self, test_info: MiroptTest) { let test_dir = self.testpaths.file.parent().unwrap(); let test_crate = self.testpaths.file.file_stem().unwrap().replace('-', "_"); - let MiroptTest { run_filecheck, suffix, files, passes: _ } = test_info; + let MiroptTest { suffix, files, passes: _ } = test_info; if self.config.bless { for e in glob(&format!("{}/{}.*{}.mir", test_dir, test_crate, suffix)).unwrap() { @@ -89,7 +78,7 @@ impl TestCx<'_> { } } - if run_filecheck { + if !self.props.skip_filecheck { let output_path = self.output_base_name().with_extension("mir"); let proc_res = self.verify_with_filecheck(&output_path); if !proc_res.status.success() { diff --git a/src/tools/compiletest/src/runtest/ui.rs b/src/tools/compiletest/src/runtest/ui.rs index 31b80d0924da4..2d8b8c057d802 100644 --- a/src/tools/compiletest/src/runtest/ui.rs +++ b/src/tools/compiletest/src/runtest/ui.rs @@ -15,10 +15,12 @@ impl TestCx<'_> { pub(super) fn run_ui_test(&self) { if let Some(FailMode::Build) = self.props.fail_mode { // Make sure a build-fail test cannot fail due to failing analysis (e.g. typeck). - let pm = Some(PassMode::Check); - let proc_res = - self.compile_test_general(WillExecute::No, Emit::Metadata, pm, Vec::new()); - self.check_if_test_should_compile(self.props.fail_mode, pm, &proc_res); + let proc_res = self.compile_test(WillExecute::No, Emit::Metadata); + self.check_if_test_should_compile( + self.props.fail_mode, + Some(PassMode::Check), + &proc_res, + ); } let pm = self.pass_mode(); diff --git a/src/tools/miri/tests/fail/c-variadic.rs b/src/tools/miri/tests/fail/c-variadic.rs index 38141c23d08de..d36dccec8d8d8 100644 --- a/src/tools/miri/tests/fail/c-variadic.rs +++ b/src/tools/miri/tests/fail/c-variadic.rs @@ -4,7 +4,7 @@ fn read_too_many() { unsafe extern "C" fn variadic(mut ap: ...) { - ap.arg::(); + ap.next_arg::(); } unsafe { variadic() }; diff --git a/src/tools/miri/tests/fail/c-variadic.stderr b/src/tools/miri/tests/fail/c-variadic.stderr index 31695f1cab49b..af145b0ed1e74 100644 --- a/src/tools/miri/tests/fail/c-variadic.stderr +++ b/src/tools/miri/tests/fail/c-variadic.stderr @@ -7,7 +7,7 @@ LL | unsafe { va_arg(self) } = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: stack backtrace: - 0: std::ffi::VaList::<'_>::arg + 0: std::ffi::VaList::<'_>::next_arg at RUSTLIB/core/src/ffi/va_list.rs:LL:CC 1: read_too_many::variadic at tests/fail/c-variadic.rs:LL:CC diff --git a/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs b/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs index b41e1b0f076af..fe09a03edfffc 100644 --- a/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs +++ b/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs @@ -13,8 +13,8 @@ fn main() { unsafe extern "C" fn variadic(mut ap: ...) { - ap.arg::(); - ap.arg::(); + ap.next_arg::(); + ap.next_arg::(); } unsafe { variadic(0i32, (), 1i32) } diff --git a/src/tools/miri/tests/pass/c-variadic.rs b/src/tools/miri/tests/pass/c-variadic.rs index 8b353885699e6..61ff1303f328f 100644 --- a/src/tools/miri/tests/pass/c-variadic.rs +++ b/src/tools/miri/tests/pass/c-variadic.rs @@ -11,7 +11,7 @@ fn ignores_arguments() { fn echo() { unsafe extern "C" fn variadic(mut ap: ...) -> i32 { - ap.arg() + ap.next_arg() } assert_eq!(unsafe { variadic(1) }, 1); @@ -20,7 +20,7 @@ fn echo() { fn forward_by_val() { unsafe fn helper(mut ap: VaList) -> i32 { - ap.arg() + ap.next_arg() } unsafe extern "C" fn variadic(ap: ...) -> i32 { @@ -33,7 +33,7 @@ fn forward_by_val() { fn forward_by_ref() { unsafe fn helper(ap: &mut VaList) -> i32 { - ap.arg() + ap.next_arg() } unsafe extern "C" fn variadic(mut ap: ...) -> i32 { @@ -47,7 +47,7 @@ fn forward_by_ref() { #[allow(improper_ctypes_definitions)] fn nested() { unsafe fn helper(mut ap1: VaList, mut ap2: VaList) -> (i32, i32) { - (ap1.arg(), ap2.arg()) + (ap1.next_arg(), ap2.next_arg()) } unsafe extern "C" fn variadic2(ap1: VaList, ap2: ...) -> (i32, i32) { @@ -83,13 +83,13 @@ fn various_types() { } } - continue_if!(ap.arg::().floor() == 3.14f64.floor()); - continue_if!(ap.arg::() == 12); - continue_if!(ap.arg::() == 'a' as c_int); - continue_if!(ap.arg::().floor() == 6.18f64.floor()); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), "Hello")); - continue_if!(ap.arg::() == 42); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), "World")); + continue_if!(ap.next_arg::().floor() == 3.14f64.floor()); + continue_if!(ap.next_arg::() == 12); + continue_if!(ap.next_arg::() == 'a' as c_int); + continue_if!(ap.next_arg::().floor() == 6.18f64.floor()); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), "Hello")); + continue_if!(ap.next_arg::() == 42); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), "World")); } unsafe { diff --git a/src/tools/miropt-test-tools/src/lib.rs b/src/tools/miropt-test-tools/src/lib.rs index 10769c9c8abfe..df1645cbf14d5 100644 --- a/src/tools/miropt-test-tools/src/lib.rs +++ b/src/tools/miropt-test-tools/src/lib.rs @@ -8,7 +8,6 @@ pub struct MiroptTestFile { } pub struct MiroptTest { - pub run_filecheck: bool, pub suffix: String, pub files: Vec, /// Vec of passes under test to be dumped @@ -57,13 +56,15 @@ pub fn files_for_miropt_test( let test_crate = testfile.file_stem().unwrap().to_str().unwrap().replace('-', "_"); let suffix = output_file_suffix(testfile, bit_width, panic_strategy); - let mut run_filecheck = true; let mut passes = Vec::new(); for l in test_file_contents.lines() { + // FIXME(Zalathar): Remove this `skip-filecheck` migration error in 2027, + // or perhaps earlier if it seems no longer useful. if l.starts_with("// skip-filecheck") { - run_filecheck = false; - continue; + panic!( + "error: `// skip-filecheck` is no longer supported, use `//@ skip-filecheck` instead." + ); } if l.starts_with("// EMIT_MIR ") { let test_name = l.trim_start_matches("// EMIT_MIR ").trim(); @@ -128,10 +129,7 @@ pub fn files_for_miropt_test( out.push(MiroptTestFile { expected_file, from_file, to_file }); } - if !run_filecheck && l.trim_start().starts_with("// CHECK") { - panic!("error: test contains filecheck directive but is marked `skip-filecheck`"); - } } - MiroptTest { run_filecheck, suffix, files: out, passes } + MiroptTest { suffix, files: out, passes } } diff --git a/tests/assembly-llvm/c-variadic-arm.rs b/tests/assembly-llvm/c-variadic-arm.rs index 2ef307405e131..1cfc115badeed 100644 --- a/tests/assembly-llvm/c-variadic-arm.rs +++ b/tests/assembly-llvm/c-variadic-arm.rs @@ -18,8 +18,8 @@ unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 { // CHECK: vadd.f64 // CHECK: vldr // CHECK: vadd.f64 - let b = args.arg::(); - let c = args.arg::(); + let b = args.next_arg::(); + let c = args.next_arg::(); a + b + c // CHECK: add sp, sp diff --git a/tests/assembly-llvm/c-variadic-mips.rs b/tests/assembly-llvm/c-variadic-mips.rs new file mode 100644 index 0000000000000..9c74eeb8a6a17 --- /dev/null +++ b/tests/assembly-llvm/c-variadic-mips.rs @@ -0,0 +1,137 @@ +//@ add-minicore +//@ assembly-output: emit-asm +// +//@ revisions: MIPS MIPS64 MIPS64EL +//@ [MIPS] compile-flags: -Copt-level=3 --target mips-unknown-linux-gnu +//@ [MIPS] needs-llvm-components: mips +//@ [MIPS64] compile-flags: -Copt-level=3 --target mipsisa64r6-unknown-linux-gnuabi64 +//@ [MIPS64] needs-llvm-components: mips +//@ [MIPS64EL] compile-flags: -Copt-level=3 --target mips64el-unknown-linux-gnuabi64 +//@ [MIPS64EL] needs-llvm-components: mips +#![feature(c_variadic, no_core, lang_items, intrinsics, rustc_attrs, asm_experimental_arch)] +#![no_core] +#![crate_type = "lib"] + +// Check that the assembly that rustc generates matches what clang emits. + +extern crate minicore; +use minicore::*; + +#[lang = "va_arg_safe"] +pub unsafe trait VaArgSafe {} + +unsafe impl VaArgSafe for i32 {} +unsafe impl VaArgSafe for i64 {} +unsafe impl VaArgSafe for f64 {} +unsafe impl VaArgSafe for *const T {} + +#[repr(transparent)] +struct VaListInner { + ptr: *const c_void, +} + +#[repr(transparent)] +#[lang = "va_list"] +pub struct VaList<'a> { + inner: VaListInner, + _marker: PhantomData<&'a mut ()>, +} + +#[rustc_intrinsic] +#[rustc_nounwind] +pub const unsafe fn va_arg(ap: &mut VaList<'_>) -> T; + +#[unsafe(no_mangle)] +unsafe extern "C" fn read_f64(ap: &mut VaList<'_>) -> f64 { + // CHECK-LABEL: read_f64 + // + // MIPS: lw $1, 0($4) + // MIPS-NEXT: addiu $2, $zero, -8 + // MIPS-NEXT: addiu $1, $1, 7 + // MIPS-NEXT: and $1, $1, $2 + // MIPS-NEXT: addiu $2, $1, 8 + // MIPS-NEXT: sw $2, 0($4) + // MIPS-NEXT: ldc1 $f0, 0($1) + // MIPS-NEXT: jr $ra + // MIPS-NEXT: nop + // + // MIPS64: ld $1, 0($4) + // MIPS64-NEXT: daddiu $2, $1, 8 + // MIPS64-NEXT: sd $2, 0($4) + // MIPS64-NEXT: ldc1 $f0, 0($1) + // MIPS64-NEXT: jrc $ra + // + // MIPS64EL: ld $1, 0($4) + // MIPS64EL-NEXT: daddiu $2, $1, 8 + // MIPS64EL-NEXT: sd $2, 0($4) + // MIPS64EL-NEXT: ldc1 $f0, 0($1) + // MIPS64EL-NEXT: jr $ra + // MIPS64EL-NEXT: nop + va_arg(ap) +} + +#[unsafe(no_mangle)] +unsafe extern "C" fn read_i32(ap: &mut VaList<'_>) -> i32 { + // CHECK-LABEL: read_i32 + // + // MIPS: lw $1, 0($4) + // MIPS-NEXT: addiu $2, $1, 4 + // MIPS-NEXT: sw $2, 0($4) + // MIPS-NEXT: lw $2, 0($1) + // MIPS-NEXT: jr $ra + // MIPS-NEXT: nop + // + // MIPS64: ld $1, 0($4) + // MIPS64-NEXT: daddiu $2, $1, 8 + // MIPS64-NEXT: sd $2, 0($4) + // MIPS64-NEXT: lw $2, 4($1) + // MIPS64-NEXT: jrc $ra + // + // MIPS64EL: ld $1, 0($4) + // MIPS64EL-NEXT: daddiu $2, $1, 8 + // MIPS64EL-NEXT: sd $2, 0($4) + // MIPS64EL-NEXT: lw $2, 0($1) + // MIPS64EL-NEXT: jr $ra + // MIPS64EL-NEXT: nop + va_arg(ap) +} + +#[unsafe(no_mangle)] +unsafe extern "C" fn read_i64(ap: &mut VaList<'_>) -> i64 { + // CHECK-LABEL: read_i64 + // + // MIPS: lw $1, 0($4) + // MIPS-NEXT: addiu $2, $zero, -8 + // MIPS-NEXT: addiu $1, $1, 7 + // MIPS-NEXT: and $2, $1, $2 + // MIPS-NEXT: addiu $3, $2, 8 + // MIPS-NEXT: sw $3, 0($4) + // MIPS-NEXT: addiu $3, $zero, 4 + // MIPS-NEXT: lw $2, 0($2) + // MIPS-NEXT: ins $1, $3, 0, 3 + // MIPS-NEXT: lw $3, 0($1) + // MIPS-NEXT: jr $ra + // MIPS-NEXT: nop + // + // MIPS64: ld $1, 0($4) + // MIPS64-NEXT: daddiu $2, $1, 8 + // MIPS64-NEXT: sd $2, 0($4) + // MIPS64-NEXT: ld $2, 0($1) + // MIPS64-NEXT: jrc $ra + // + // MIPS64EL: ld $1, 0($4) + // MIPS64EL-NEXT: daddiu $2, $1, 8 + // MIPS64EL-NEXT: sd $2, 0($4) + // MIPS64EL-NEXT: ld $2, 0($1) + // MIPS64EL-NEXT: jr $ra + // MIPS64EL-NEXT: nop + va_arg(ap) +} + +#[unsafe(no_mangle)] +unsafe extern "C" fn read_ptr(ap: &mut VaList<'_>) -> *const u8 { + // MIPS: read_ptr = read_i32 + // MIPS64: read_ptr = read_i64 + // MIPS64EL: read_ptr = read_i64 + va_arg(ap) +} diff --git a/tests/codegen-llvm/c-variadic-lifetime.rs b/tests/codegen-llvm/c-variadic-lifetime.rs index fa38fbbc5381d..302bc621df497 100644 --- a/tests/codegen-llvm/c-variadic-lifetime.rs +++ b/tests/codegen-llvm/c-variadic-lifetime.rs @@ -11,8 +11,8 @@ unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 { // CHECK: call void @llvm.lifetime.start.p0({{(i64 [0-9]+, )?}}ptr nonnull %args) // CHECK: call void @llvm.va_start.p0(ptr nonnull %args) - let b = args.arg::(); - let c = args.arg::(); + let b = args.next_arg::(); + let c = args.next_arg::(); a + b + c diff --git a/tests/codegen-llvm/cffi/c-variadic-inline.rs b/tests/codegen-llvm/cffi/c-variadic-inline.rs index 369b7e571cabb..0df5bd4a55b50 100644 --- a/tests/codegen-llvm/cffi/c-variadic-inline.rs +++ b/tests/codegen-llvm/cffi/c-variadic-inline.rs @@ -8,22 +8,22 @@ #[inline(always)] unsafe extern "C" fn inline_always(mut ap: ...) -> u32 { - ap.arg::() + ap.next_arg::() } #[inline] unsafe extern "C" fn inline(mut ap: ...) -> u32 { - ap.arg::() + ap.next_arg::() } #[inline(never)] unsafe extern "C" fn inline_never(mut ap: ...) -> u32 { - ap.arg::() + ap.next_arg::() } #[cold] unsafe extern "C" fn cold(mut ap: ...) -> u32 { - ap.arg::() + ap.next_arg::() } #[unsafe(no_mangle)] diff --git a/tests/codegen-llvm/cffi/c-variadic.rs b/tests/codegen-llvm/cffi/c-variadic.rs index 5df256961de57..0fa63b42c2de6 100644 --- a/tests/codegen-llvm/cffi/c-variadic.rs +++ b/tests/codegen-llvm/cffi/c-variadic.rs @@ -28,7 +28,7 @@ pub unsafe extern "C" fn c_variadic(n: i32, mut ap: ...) -> i32 { // CHECK: call void @llvm.va_start let mut sum = 0; for _ in 0..n { - sum += ap.arg::(); + sum += ap.next_arg::(); } sum // CHECK: call void @llvm.va_end diff --git a/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs b/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs index e19fc40cb9d67..7a990b29e6ca1 100644 --- a/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs +++ b/tests/codegen-llvm/scalable-vectors/tuple-intrinsics.rs @@ -1,4 +1,5 @@ -//@ build-pass +// FIXME: The FileCheck directives in this test are unchecked and probably broken. +//@ skip-filecheck //@ only-aarch64 #![crate_type = "lib"] #![allow(incomplete_features, internal_features)] diff --git a/tests/codegen-llvm/simd/simd-wide-sum.rs b/tests/codegen-llvm/simd/simd-wide-sum.rs index 95117b2c74882..68febe00d1b9d 100644 --- a/tests/codegen-llvm/simd/simd-wide-sum.rs +++ b/tests/codegen-llvm/simd/simd-wide-sum.rs @@ -3,7 +3,7 @@ //@ edition: 2021 //@ only-x86_64 //@ [mir-opt3]compile-flags: -Zmir-opt-level=3 -//@ [mir-opt3]build-pass +//@ [mir-opt3] skip-filecheck // mir-opt3 is a regression test for https://github.com/rust-lang/rust/issues/98016 diff --git a/tests/mir-opt/README.md b/tests/mir-opt/README.md index e4b252f5565b0..69705dbf2b8a4 100644 --- a/tests/mir-opt/README.md +++ b/tests/mir-opt/README.md @@ -57,7 +57,7 @@ The LLVM FileCheck tool is used to verify the contents of output MIR against `CH present in the test file. This works on the runtime MIR, generated by `--emit=mir`, and not on the output of a individual passes. -Use `// skip-filecheck` to prevent FileCheck from running. +Use `//@ skip-filecheck` to prevent FileCheck from running. To check MIR for function `foo`, start with a `// CHECK-LABEL fn foo(` directive. diff --git a/tests/mir-opt/address_of.rs b/tests/mir-opt/address_of.rs index 164ab38ebe754..0e97bc8c6fe6d 100644 --- a/tests/mir-opt/address_of.rs +++ b/tests/mir-opt/address_of.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR address_of.address_of_reborrow.SimplifyCfg-initial.after.mir fn address_of_reborrow() { diff --git a/tests/mir-opt/async_closure_fake_read_for_by_move.rs b/tests/mir-opt/async_closure_fake_read_for_by_move.rs index e78671f5e9d56..08a4c8a4edcb1 100644 --- a/tests/mir-opt/async_closure_fake_read_for_by_move.rs +++ b/tests/mir-opt/async_closure_fake_read_for_by_move.rs @@ -1,5 +1,5 @@ //@ edition:2021 -// skip-filecheck +//@ skip-filecheck enum Foo { Bar, diff --git a/tests/mir-opt/async_closure_shims.rs b/tests/mir-opt/async_closure_shims.rs index 93cc7834a643f..7bf937164d5df 100644 --- a/tests/mir-opt/async_closure_shims.rs +++ b/tests/mir-opt/async_closure_shims.rs @@ -1,5 +1,5 @@ //@ edition:2021 -// skip-filecheck +//@ skip-filecheck #![allow(unused)] diff --git a/tests/mir-opt/async_drop_live_dead.rs b/tests/mir-opt/async_drop_live_dead.rs index 348866bbb8c75..12b9d527dfad4 100644 --- a/tests/mir-opt/async_drop_live_dead.rs +++ b/tests/mir-opt/async_drop_live_dead.rs @@ -1,5 +1,5 @@ //@ edition:2024 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![feature(async_drop)] diff --git a/tests/mir-opt/async_drop_mir_pin.rs b/tests/mir-opt/async_drop_mir_pin.rs index 35626f13f8945..47f69b611a358 100644 --- a/tests/mir-opt/async_drop_mir_pin.rs +++ b/tests/mir-opt/async_drop_mir_pin.rs @@ -1,6 +1,6 @@ //@edition: 2024 //@ test-mir-pass: MentionedItems -// skip-filecheck +//@ skip-filecheck #![feature(async_drop)] #![allow(incomplete_features)] use std::future::AsyncDrop; diff --git a/tests/mir-opt/box_conditional_drop_allocator.rs b/tests/mir-opt/box_conditional_drop_allocator.rs index 9471be14c8770..741c396b0c2d7 100644 --- a/tests/mir-opt/box_conditional_drop_allocator.rs +++ b/tests/mir-opt/box_conditional_drop_allocator.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: ElaborateDrops //@ needs-unwind #![feature(allocator_api)] diff --git a/tests/mir-opt/build_correct_coerce.rs b/tests/mir-opt/build_correct_coerce.rs index b6c861636dcaa..004e1309b0b26 100644 --- a/tests/mir-opt/build_correct_coerce.rs +++ b/tests/mir-opt/build_correct_coerce.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Validate that we record the target for the `as` coercion as `for<'a> fn(&'a (), &'a ())`, // and not `for<'a, 'b>(&'a (), &'b ())`. We previously did the latter due to a bug in diff --git a/tests/mir-opt/building/async_await.rs b/tests/mir-opt/building/async_await.rs index 2d14a1fb0c6f7..e84f8a6c561bc 100644 --- a/tests/mir-opt/building/async_await.rs +++ b/tests/mir-opt/building/async_await.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // This test makes sure that the coroutine MIR pass eliminates all calls to // `get_context`, and that the MIR argument type for an async fn and all locals // related to `yield` are `&mut Context`, and its return type is `Poll`. diff --git a/tests/mir-opt/building/coroutine.rs b/tests/mir-opt/building/coroutine.rs index 6d50c4d90b1a4..77388c8786aaa 100644 --- a/tests/mir-opt/building/coroutine.rs +++ b/tests/mir-opt/building/coroutine.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ edition:2024 //@ compile-flags: -Zmir-opt-level=0 -C panic=abort diff --git a/tests/mir-opt/building/custom/aggregate_exprs.rs b/tests/mir-opt/building/custom/aggregate_exprs.rs index 8985f106817b0..ec81e9a7f21ca 100644 --- a/tests/mir-opt/building/custom/aggregate_exprs.rs +++ b/tests/mir-opt/building/custom/aggregate_exprs.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/arbitrary_let.rs b/tests/mir-opt/building/custom/arbitrary_let.rs index 3f251cd81bce4..5075fb234d490 100644 --- a/tests/mir-opt/building/custom/arbitrary_let.rs +++ b/tests/mir-opt/building/custom/arbitrary_let.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/arrays.rs b/tests/mir-opt/building/custom/arrays.rs index e9cdded4a0e68..2022292d3e41f 100644 --- a/tests/mir-opt/building/custom/arrays.rs +++ b/tests/mir-opt/building/custom/arrays.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/as_cast.rs b/tests/mir-opt/building/custom/as_cast.rs index 908d378771d5a..e8e7fb265df84 100644 --- a/tests/mir-opt/building/custom/as_cast.rs +++ b/tests/mir-opt/building/custom/as_cast.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/assume.rs b/tests/mir-opt/building/custom/assume.rs index 4a55617136a10..cbbebee820d31 100644 --- a/tests/mir-opt/building/custom/assume.rs +++ b/tests/mir-opt/building/custom/assume.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/composite_return.rs b/tests/mir-opt/building/custom/composite_return.rs index 0cf2cc8d18908..4e85e9a33d740 100644 --- a/tests/mir-opt/building/custom/composite_return.rs +++ b/tests/mir-opt/building/custom/composite_return.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/consts.rs b/tests/mir-opt/building/custom/consts.rs index c64709082dc31..4f1a55a81dfaa 100644 --- a/tests/mir-opt/building/custom/consts.rs +++ b/tests/mir-opt/building/custom/consts.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/enums.rs b/tests/mir-opt/building/custom/enums.rs index 6fad373203a69..ec2922922d73d 100644 --- a/tests/mir-opt/building/custom/enums.rs +++ b/tests/mir-opt/building/custom/enums.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/operators.rs b/tests/mir-opt/building/custom/operators.rs index 07abf2d965172..7e9ff6c6d5a55 100644 --- a/tests/mir-opt/building/custom/operators.rs +++ b/tests/mir-opt/building/custom/operators.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: --crate-type=lib #![feature(custom_mir, core_intrinsics)] use std::intrinsics::mir::*; diff --git a/tests/mir-opt/building/custom/projections.rs b/tests/mir-opt/building/custom/projections.rs index e59eebd9952d7..97d38ecf033b1 100644 --- a/tests/mir-opt/building/custom/projections.rs +++ b/tests/mir-opt/building/custom/projections.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/references.rs b/tests/mir-opt/building/custom/references.rs index 7ea8f8b4c156d..18169792bd8fe 100644 --- a/tests/mir-opt/building/custom/references.rs +++ b/tests/mir-opt/building/custom/references.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/simple_assign.rs b/tests/mir-opt/building/custom/simple_assign.rs index d6d054ab5a389..949d8fbee9c0f 100644 --- a/tests/mir-opt/building/custom/simple_assign.rs +++ b/tests/mir-opt/building/custom/simple_assign.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/custom/terminators.rs b/tests/mir-opt/building/custom/terminators.rs index ed08040a2a58c..1bd796c248f82 100644 --- a/tests/mir-opt/building/custom/terminators.rs +++ b/tests/mir-opt/building/custom/terminators.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(custom_mir, core_intrinsics)] extern crate core; diff --git a/tests/mir-opt/building/enum_cast.rs b/tests/mir-opt/building/enum_cast.rs index 07025f572ab20..5beae823bcc77 100644 --- a/tests/mir-opt/building/enum_cast.rs +++ b/tests/mir-opt/building/enum_cast.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR enum_cast.foo.built.after.mir // EMIT_MIR enum_cast.bar.built.after.mir // EMIT_MIR enum_cast.boo.built.after.mir diff --git a/tests/mir-opt/building/eq_never_type.rs b/tests/mir-opt/building/eq_never_type.rs index 486e2f9fb8dfa..762f20ee1e104 100644 --- a/tests/mir-opt/building/eq_never_type.rs +++ b/tests/mir-opt/building/eq_never_type.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck #![feature(never_type)] #![allow(unreachable_code)] diff --git a/tests/mir-opt/building/issue_101867.rs b/tests/mir-opt/building/issue_101867.rs index a00bc13b3fe5f..91f078ccb1190 100644 --- a/tests/mir-opt/building/issue_101867.rs +++ b/tests/mir-opt/building/issue_101867.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR issue_101867.main.built.after.mir fn main() { let x: Option = Some(1); diff --git a/tests/mir-opt/building/issue_110508.rs b/tests/mir-opt/building/issue_110508.rs index aa8a7b1d08f4a..5f94f2658bf7e 100644 --- a/tests/mir-opt/building/issue_110508.rs +++ b/tests/mir-opt/building/issue_110508.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR issue_110508.{impl#0}-BAR.built.after.mir // EMIT_MIR issue_110508.{impl#0}-SELF_BAR.built.after.mir diff --git a/tests/mir-opt/building/issue_49232.rs b/tests/mir-opt/building/issue_49232.rs index f17e3e955a41c..6772d5aea0b88 100644 --- a/tests/mir-opt/building/issue_49232.rs +++ b/tests/mir-opt/building/issue_49232.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // We must mark a variable whose initialization fails due to an // abort statement as StorageDead. diff --git a/tests/mir-opt/building/logical_or_in_conditional.rs b/tests/mir-opt/building/logical_or_in_conditional.rs index d1c1ea2896aaf..0abf2b24ddaa2 100644 --- a/tests/mir-opt/building/logical_or_in_conditional.rs +++ b/tests/mir-opt/building/logical_or_in_conditional.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 -Z validate-mir //@ edition: 2024 struct Droppy(u8); diff --git a/tests/mir-opt/building/loop_match_diverges.rs b/tests/mir-opt/building/loop_match_diverges.rs index 774e195c33c96..bef91c42472c0 100644 --- a/tests/mir-opt/building/loop_match_diverges.rs +++ b/tests/mir-opt/building/loop_match_diverges.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![allow(incomplete_features)] #![feature(loop_match)] #![crate_type = "lib"] diff --git a/tests/mir-opt/building/match/deref-patterns/string.rs b/tests/mir-opt/building/match/deref-patterns/string.rs index 92232c7df79dc..2426cb7d1a759 100644 --- a/tests/mir-opt/building/match/deref-patterns/string.rs +++ b/tests/mir-opt/building/match/deref-patterns/string.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=0 -C panic=abort #![feature(deref_patterns)] diff --git a/tests/mir-opt/building/match/exponential_or.rs b/tests/mir-opt/building/match/exponential_or.rs index 89963b9bdf444..e6ed7107b8b33 100644 --- a/tests/mir-opt/building/match/exponential_or.rs +++ b/tests/mir-opt/building/match/exponential_or.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that simple or-patterns don't get expanded to exponentially large CFGs // EMIT_MIR exponential_or.match_tuple.SimplifyCfg-initial.after.mir diff --git a/tests/mir-opt/building/match/match_false_edges.rs b/tests/mir-opt/building/match/match_false_edges.rs index 839eda40c8540..d58d9d406b88f 100644 --- a/tests/mir-opt/building/match/match_false_edges.rs +++ b/tests/mir-opt/building/match/match_false_edges.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck fn guard() -> bool { false } diff --git a/tests/mir-opt/building/match/simple_match.rs b/tests/mir-opt/building/match/simple_match.rs index c8b3d90748afb..ca084093f9027 100644 --- a/tests/mir-opt/building/match/simple_match.rs +++ b/tests/mir-opt/building/match/simple_match.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that we don't generate unnecessarily large MIR for very simple matches // EMIT_MIR simple_match.match_bool.built.after.mir diff --git a/tests/mir-opt/building/receiver_ptr_mutability.rs b/tests/mir-opt/building/receiver_ptr_mutability.rs index 37b142f1d8ad2..d9adcc74b02e9 100644 --- a/tests/mir-opt/building/receiver_ptr_mutability.rs +++ b/tests/mir-opt/building/receiver_ptr_mutability.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // EMIT_MIR receiver_ptr_mutability.main.built.after.mir #![feature(arbitrary_self_types_pointers)] diff --git a/tests/mir-opt/building/shifts.rs b/tests/mir-opt/building/shifts.rs index 165b388bc18b5..947e2394cfaa6 100644 --- a/tests/mir-opt/building/shifts.rs +++ b/tests/mir-opt/building/shifts.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 -C debug-assertions=yes // EMIT_MIR shifts.shift_signed.built.after.mir diff --git a/tests/mir-opt/building/storage_live_dead_in_statics.rs b/tests/mir-opt/building/storage_live_dead_in_statics.rs index 868f4a8f55974..1d78c4f188c5c 100644 --- a/tests/mir-opt/building/storage_live_dead_in_statics.rs +++ b/tests/mir-opt/building/storage_live_dead_in_statics.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // Check that when we compile the static `XXX` into MIR, we do not // generate `StorageStart` or `StorageEnd` statements. diff --git a/tests/mir-opt/building/uniform_array_move_out.rs b/tests/mir-opt/building/uniform_array_move_out.rs index 573e64f26dcb6..58a3aa2275fd8 100644 --- a/tests/mir-opt/building/uniform_array_move_out.rs +++ b/tests/mir-opt/building/uniform_array_move_out.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 -// skip-filecheck +//@ skip-filecheck // Can't emit `built.after` here as that contains user type annotations which contain DefId that // change all the time. diff --git a/tests/mir-opt/building/user_type_annotations.rs b/tests/mir-opt/building/user_type_annotations.rs index 527bf62f7dc05..ecfb55be51afd 100644 --- a/tests/mir-opt/building/user_type_annotations.rs +++ b/tests/mir-opt/building/user_type_annotations.rs @@ -1,6 +1,6 @@ //@ compile-flags: -Zmir-opt-level=0 //@ edition: 2024 -// skip-filecheck +//@ skip-filecheck // This test demonstrates how many user type annotations are recorded in MIR // for various binding constructs. In particular, this makes it possible to see diff --git a/tests/mir-opt/byte_slice.rs b/tests/mir-opt/byte_slice.rs index fa616b62ad0b2..cd37c3090c7cf 100644 --- a/tests/mir-opt/byte_slice.rs +++ b/tests/mir-opt/byte_slice.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=0 // EMIT_MIR byte_slice.main.SimplifyCfg-pre-optimizations.after.mir diff --git a/tests/mir-opt/const_allocation.rs b/tests/mir-opt/const_allocation.rs index e65b2ed9a879c..c4f2986a8fb92 100644 --- a/tests/mir-opt/const_allocation.rs +++ b/tests/mir-opt/const_allocation.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_allocation2.rs b/tests/mir-opt/const_allocation2.rs index 0681d4356dd8e..f86462ff3805b 100644 --- a/tests/mir-opt/const_allocation2.rs +++ b/tests/mir-opt/const_allocation2.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_allocation3.rs b/tests/mir-opt/const_allocation3.rs index 9d2006b6fe80d..2f1cbbf7b330a 100644 --- a/tests/mir-opt/const_allocation3.rs +++ b/tests/mir-opt/const_allocation3.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_goto_const_eval_fail.rs b/tests/mir-opt/const_goto_const_eval_fail.rs index fa0f5f6145908..df23c6e5030ca 100644 --- a/tests/mir-opt/const_goto_const_eval_fail.rs +++ b/tests/mir-opt/const_goto_const_eval_fail.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(min_const_generics)] #![crate_type = "lib"] diff --git a/tests/mir-opt/const_promotion_extern_static.rs b/tests/mir-opt/const_promotion_extern_static.rs index fe258f5e8fdb3..f16a53270a97d 100644 --- a/tests/mir-opt/const_promotion_extern_static.rs +++ b/tests/mir-opt/const_promotion_extern_static.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ ignore-endian-big extern "C" { static X: i32; diff --git a/tests/mir-opt/const_prop/invalid_constant.rs b/tests/mir-opt/const_prop/invalid_constant.rs index 901c3721d9238..f0e1f30a82fe7 100644 --- a/tests/mir-opt/const_prop/invalid_constant.rs +++ b/tests/mir-opt/const_prop/invalid_constant.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ compile-flags: -Zmir-enable-passes=+RemoveZsts -Zdump-mir-exclude-alloc-bytes // Verify that we can pretty print invalid constants. diff --git a/tests/mir-opt/const_prop/large_array_index.rs b/tests/mir-opt/const_prop/large_array_index.rs index afba73f6a17f7..b22a0e4015869 100644 --- a/tests/mir-opt/const_prop/large_array_index.rs +++ b/tests/mir-opt/const_prop/large_array_index.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/const_prop/offset_of.rs b/tests/mir-opt/const_prop/offset_of.rs index c2f5e83d6868f..ae0d54939186a 100644 --- a/tests/mir-opt/const_prop/offset_of.rs +++ b/tests/mir-opt/const_prop/offset_of.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/coroutine_drop_cleanup.rs b/tests/mir-opt/coroutine_drop_cleanup.rs index 4ae97273cd90a..f73fa6ea64f51 100644 --- a/tests/mir-opt/coroutine_drop_cleanup.rs +++ b/tests/mir-opt/coroutine_drop_cleanup.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(coroutines, coroutine_trait, stmt_expr_attributes)] // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/coroutine_storage_dead_unwind.rs b/tests/mir-opt/coroutine_storage_dead_unwind.rs index ce9bad483af83..0537aedcf230b 100644 --- a/tests/mir-opt/coroutine_storage_dead_unwind.rs +++ b/tests/mir-opt/coroutine_storage_dead_unwind.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Test that we generate StorageDead on unwind paths for coroutines. diff --git a/tests/mir-opt/coroutine_tiny.rs b/tests/mir-opt/coroutine_tiny.rs index 81e9940541ba0..b92628aebf96a 100644 --- a/tests/mir-opt/coroutine_tiny.rs +++ b/tests/mir-opt/coroutine_tiny.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //! Tests that coroutines that cannot return or unwind don't have unnecessary //! panic branches. diff --git a/tests/mir-opt/coverage/branch_match_arms.rs b/tests/mir-opt/coverage/branch_match_arms.rs index 18764b38d6e3e..10e0b27aeec86 100644 --- a/tests/mir-opt/coverage/branch_match_arms.rs +++ b/tests/mir-opt/coverage/branch_match_arms.rs @@ -1,7 +1,7 @@ #![feature(coverage_attribute)] //@ test-mir-pass: InstrumentCoverage //@ compile-flags: -Cinstrument-coverage -Zno-profiler-runtime -Zcoverage-options=branch -// skip-filecheck +//@ skip-filecheck enum Enum { A(u32), diff --git a/tests/mir-opt/dataflow.rs b/tests/mir-opt/dataflow.rs index 5ed3da4c531a8..01981dfbec8b0 100644 --- a/tests/mir-opt/dataflow.rs +++ b/tests/mir-opt/dataflow.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test graphviz dataflow output //@ compile-flags: -Z dump-mir=main -Z dump-mir-dataflow diff --git a/tests/mir-opt/derefer_complex_case.rs b/tests/mir-opt/derefer_complex_case.rs index 96034522b9fe0..87968618b7a5f 100644 --- a/tests/mir-opt/derefer_complex_case.rs +++ b/tests/mir-opt/derefer_complex_case.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_complex_case.main.Derefer.diff // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/derefer_inline_test.rs b/tests/mir-opt/derefer_inline_test.rs index 7f9272bdec852..26ff026a96fc2 100644 --- a/tests/mir-opt/derefer_inline_test.rs +++ b/tests/mir-opt/derefer_inline_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_inline_test.main.Derefer.diff // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/derefer_terminator_test.rs b/tests/mir-opt/derefer_terminator_test.rs index fd16c6c2045ed..ebc8bb9ae94d5 100644 --- a/tests/mir-opt/derefer_terminator_test.rs +++ b/tests/mir-opt/derefer_terminator_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_terminator_test.main.Derefer.diff // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/derefer_test.rs b/tests/mir-opt/derefer_test.rs index 5676fa657fe91..078c6c1ba0438 100644 --- a/tests/mir-opt/derefer_test.rs +++ b/tests/mir-opt/derefer_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_test.main.Derefer.diff fn main() { diff --git a/tests/mir-opt/derefer_test_multiple.rs b/tests/mir-opt/derefer_test_multiple.rs index 7c03af00e1e6b..d2b33edbe484b 100644 --- a/tests/mir-opt/derefer_test_multiple.rs +++ b/tests/mir-opt/derefer_test_multiple.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Derefer // EMIT_MIR derefer_test_multiple.main.Derefer.diff fn main() { diff --git a/tests/mir-opt/dest-prop/nrvo_borrowed.rs b/tests/mir-opt/dest-prop/nrvo_borrowed.rs index 6f3076d4c13e9..b2a01abb12b43 100644 --- a/tests/mir-opt/dest-prop/nrvo_borrowed.rs +++ b/tests/mir-opt/dest-prop/nrvo_borrowed.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ test-mir-pass: DestinationPropagation diff --git a/tests/mir-opt/dont_inline_type_id.rs b/tests/mir-opt/dont_inline_type_id.rs index d389733457b8c..e23df9ac3dfda 100644 --- a/tests/mir-opt/dont_inline_type_id.rs +++ b/tests/mir-opt/dont_inline_type_id.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ compile-flags: --crate-type=lib -C panic=abort diff --git a/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs b/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs index 0046e7104f1c6..3897f58df0415 100644 --- a/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs +++ b/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: ElaborateBoxDerefs #![feature(custom_mir, core_intrinsics)] diff --git a/tests/mir-opt/enum_opt.rs b/tests/mir-opt/enum_opt.rs index 45a3edca90ed3..90697a71cdfc1 100644 --- a/tests/mir-opt/enum_opt.rs +++ b/tests/mir-opt/enum_opt.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: EnumSizeOpt // EMIT_MIR_FOR_EACH_BIT_WIDTH //@ compile-flags: -Zunsound-mir-opts diff --git a/tests/mir-opt/fn_ptr_shim.rs b/tests/mir-opt/fn_ptr_shim.rs index 326188efe019a..0f46f2fc2004f 100644 --- a/tests/mir-opt/fn_ptr_shim.rs +++ b/tests/mir-opt/fn_ptr_shim.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 // Tests that the `` shim does not create a `Call` terminator with a `Self` callee diff --git a/tests/mir-opt/funky_arms.rs b/tests/mir-opt/funky_arms.rs index 8018f26997e46..6edfe27162f96 100644 --- a/tests/mir-opt/funky_arms.rs +++ b/tests/mir-opt/funky_arms.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR_FOR_EACH_BIT_WIDTH diff --git a/tests/mir-opt/global_asm.rs b/tests/mir-opt/global_asm.rs index 22b782d365e94..f6b705a225f2a 100644 --- a/tests/mir-opt/global_asm.rs +++ b/tests/mir-opt/global_asm.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ needs-asm-support // `global_asm!` gets a fake body, make sure it is handled correctly diff --git a/tests/mir-opt/graphviz.rs b/tests/mir-opt/graphviz.rs index f5e8fd77d854c..2537dcab0d3a8 100644 --- a/tests/mir-opt/graphviz.rs +++ b/tests/mir-opt/graphviz.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test graphviz output //@ compile-flags: -Z dump-mir-graphviz diff --git a/tests/mir-opt/gvn_on_unsafe_binder.rs b/tests/mir-opt/gvn_on_unsafe_binder.rs index b3c0576f99067..81289c50c9957 100644 --- a/tests/mir-opt/gvn_on_unsafe_binder.rs +++ b/tests/mir-opt/gvn_on_unsafe_binder.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN // EMIT_MIR gvn_on_unsafe_binder.test.GVN.diff diff --git a/tests/mir-opt/gvn_ptr_eq_with_constant.rs b/tests/mir-opt/gvn_ptr_eq_with_constant.rs index 05445208e070f..31ccec4c583dc 100644 --- a/tests/mir-opt/gvn_ptr_eq_with_constant.rs +++ b/tests/mir-opt/gvn_ptr_eq_with_constant.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: GVN //@ only-64bit //@ compile-flags: -Z mir-enable-passes=+Inline diff --git a/tests/mir-opt/gvn_uninhabited.rs b/tests/mir-opt/gvn_uninhabited.rs index 015949c5d20b9..78afc0efef900 100644 --- a/tests/mir-opt/gvn_uninhabited.rs +++ b/tests/mir-opt/gvn_uninhabited.rs @@ -1,7 +1,7 @@ //@ test-mir-pass: GVN //@ compile-flags: -O // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck #![feature(never_type)] diff --git a/tests/mir-opt/impossible_predicates.rs b/tests/mir-opt/impossible_predicates.rs index 34adf7f916144..3858bb657635d 100644 --- a/tests/mir-opt/impossible_predicates.rs +++ b/tests/mir-opt/impossible_predicates.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR impossible_predicates.impossible_predicate.ImpossiblePredicates.diff pub fn impossible_predicate(x: &mut i32) -> (&mut i32, &mut i32) diff --git a/tests/mir-opt/inline/inline_async.rs b/tests/mir-opt/inline/inline_async.rs index c5684f51cce5d..49ba0f415edef 100644 --- a/tests/mir-opt/inline/inline_async.rs +++ b/tests/mir-opt/inline/inline_async.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Checks that inliner doesn't introduce cycles when optimizing coroutines. // The outcome of optimization is not verfied, just the absence of the cycle. // Regression test for #76181. diff --git a/tests/mir-opt/inline/inline_compatibility.rs b/tests/mir-opt/inline/inline_compatibility.rs index 2b8280a3cfb00..a894bdf76842d 100644 --- a/tests/mir-opt/inline/inline_compatibility.rs +++ b/tests/mir-opt/inline/inline_compatibility.rs @@ -70,7 +70,7 @@ unsafe extern "C" fn sum(n: u32, mut vs: ...) -> u32 { let mut s = 0; let mut i = 0; while i != n { - s += vs.arg::(); + s += vs.next_arg::(); i += 1; } s diff --git a/tests/mir-opt/inline/inline_cycle.rs b/tests/mir-opt/inline/inline_cycle.rs index 651112ccfd7f2..9af70c416b3a9 100644 --- a/tests/mir-opt/inline/inline_cycle.rs +++ b/tests/mir-opt/inline/inline_cycle.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -C debuginfo=full // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Check that inliner handles various forms of recursion and doesn't fall into diff --git a/tests/mir-opt/inline/inline_cycle_generic.rs b/tests/mir-opt/inline/inline_cycle_generic.rs index 64f208b1c70b5..fd2f54c901d6a 100644 --- a/tests/mir-opt/inline/inline_cycle_generic.rs +++ b/tests/mir-opt/inline/inline_cycle_generic.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Check that inliner handles various forms of recursion and doesn't fall into // an infinite inlining cycle. The particular outcome of inlining is not diff --git a/tests/mir-opt/inline/polymorphic_recursion.rs b/tests/mir-opt/inline/polymorphic_recursion.rs index 0338d604635e7..e5a395822c6d1 100644 --- a/tests/mir-opt/inline/polymorphic_recursion.rs +++ b/tests/mir-opt/inline/polymorphic_recursion.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Make sure that the MIR inliner does not loop indefinitely on polymorphic recursion. //@ compile-flags: --crate-type lib diff --git a/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs b/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs index 866d6fbd9e971..8a126d04d5e68 100644 --- a/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs +++ b/tests/mir-opt/inline/recursion_limit_prevents_cycle_discovery.rs @@ -1,6 +1,6 @@ //@ aux-build: wrapper.rs //@ compile-flags: -Zmir-opt-level=2 -Zinline-mir -// skip-filecheck +//@ skip-filecheck // This is a regression test for https://github.com/rust-lang/rust/issues/146998 diff --git a/tests/mir-opt/inline/type_overflow.rs b/tests/mir-opt/inline/type_overflow.rs index bfd9e71b9e73f..546514a6c1aad 100644 --- a/tests/mir-opt/inline/type_overflow.rs +++ b/tests/mir-opt/inline/type_overflow.rs @@ -1,7 +1,7 @@ // This is a regression test for one of the problems in #128887; it checks that the // strategy in #129714 avoids trait solver overflows in this specific case. -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zinline-mir pub trait Foo { diff --git a/tests/mir-opt/inline/unit_test.rs b/tests/mir-opt/inline/unit_test.rs index bebe69384612e..562b8e4117115 100644 --- a/tests/mir-opt/inline/unit_test.rs +++ b/tests/mir-opt/inline/unit_test.rs @@ -1,6 +1,6 @@ // Check that `-Zmir-enable-passes=+Inline` does not ICE because of stolen MIR. //@ test-mir-pass: Inline -// skip-filecheck +//@ skip-filecheck #![crate_type = "lib"] // Randomize `def_path_hash` by defining them under a module with different names diff --git a/tests/mir-opt/inline_coroutine_body.rs b/tests/mir-opt/inline_coroutine_body.rs index 4326ff8a11b39..c97738baa882b 100644 --- a/tests/mir-opt/inline_coroutine_body.rs +++ b/tests/mir-opt/inline_coroutine_body.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ edition: 2021 //@ compile-flags: -Zinline-mir-hint-threshold=10000 -Zinline-mir-threshold=10000 --crate-type=lib diff --git a/tests/mir-opt/inline_default_trait_body.rs b/tests/mir-opt/inline_default_trait_body.rs index aeb8031b41866..cad0e4d203285 100644 --- a/tests/mir-opt/inline_default_trait_body.rs +++ b/tests/mir-opt/inline_default_trait_body.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ edition: 2021 //@ compile-flags: -Zinline-mir --crate-type=lib diff --git a/tests/mir-opt/inline_double_cycle.rs b/tests/mir-opt/inline_double_cycle.rs index cf3b87cf0ad30..e76977586f78e 100644 --- a/tests/mir-opt/inline_double_cycle.rs +++ b/tests/mir-opt/inline_double_cycle.rs @@ -1,5 +1,5 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ edition: 2021 //@ compile-flags: -Zinline-mir --crate-type=lib diff --git a/tests/mir-opt/inline_generically_if_sized.rs b/tests/mir-opt/inline_generically_if_sized.rs index e4fc94ec43626..ecd0440e7332e 100644 --- a/tests/mir-opt/inline_generically_if_sized.rs +++ b/tests/mir-opt/inline_generically_if_sized.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: Inline //@ compile-flags: --crate-type=lib -C panic=abort diff --git a/tests/mir-opt/issue_101973.rs b/tests/mir-opt/issue_101973.rs index 84a36f1374e8e..66f594028fa7e 100644 --- a/tests/mir-opt/issue_101973.rs +++ b/tests/mir-opt/issue_101973.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ compile-flags: -O -C debug-assertions=on // This needs inlining followed by GVN to reproduce, so we cannot use "test-mir-pass". diff --git a/tests/mir-opt/issue_104451_unwindable_intrinsics.rs b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs index 80655a583c348..a449c4592e84b 100644 --- a/tests/mir-opt/issue_104451_unwindable_intrinsics.rs +++ b/tests/mir-opt/issue_104451_unwindable_intrinsics.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Check that `UnwindAction::Unreachable` is not generated for unwindable intrinsics. // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![feature(core_intrinsics)] diff --git a/tests/mir-opt/issue_120925_unsafefncast.rs b/tests/mir-opt/issue_120925_unsafefncast.rs index f80ae66efdae3..06d016d0a1597 100644 --- a/tests/mir-opt/issue_120925_unsafefncast.rs +++ b/tests/mir-opt/issue_120925_unsafefncast.rs @@ -1,5 +1,5 @@ // Verify that we do not ICE when attempting to interpret casts between fn types. -// skip-filecheck +//@ skip-filecheck static FOO: fn() = || assert_ne!(42, 43); static BAR: fn(i32, i32) = |a, b| assert_ne!(a, b); diff --git a/tests/mir-opt/issue_38669.rs b/tests/mir-opt/issue_38669.rs index 9da4c89bb1218..dd63f0e6a9738 100644 --- a/tests/mir-opt/issue_38669.rs +++ b/tests/mir-opt/issue_38669.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // check that we don't StorageDead booleans before they are used // EMIT_MIR issue_38669.main.SimplifyCfg-initial.after.mir diff --git a/tests/mir-opt/issue_41110.rs b/tests/mir-opt/issue_41110.rs index 5d042815f3b4c..730db950ae9de 100644 --- a/tests/mir-opt/issue_41110.rs +++ b/tests/mir-opt/issue_41110.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // check that we don't emit multiple drop flags when they are not needed. diff --git a/tests/mir-opt/issue_41697.rs b/tests/mir-opt/issue_41697.rs index b031f1dc72018..4b79c9d178c3e 100644 --- a/tests/mir-opt/issue_41697.rs +++ b/tests/mir-opt/issue_41697.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Regression test for #41697. Using dump-mir was triggering // artificial cycles: during type-checking, we had to get the MIR for // the constant expressions in `[u8; 2]`, which in turn would trigger diff --git a/tests/mir-opt/issue_41888.rs b/tests/mir-opt/issue_41888.rs index 1744d9f857013..fc1073c334149 100644 --- a/tests/mir-opt/issue_41888.rs +++ b/tests/mir-opt/issue_41888.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // check that we clear the "ADT master drop flag" even when there are // no fields to be dropped. diff --git a/tests/mir-opt/issue_62289.rs b/tests/mir-opt/issue_62289.rs index 6db2ec2a3719b..a1ed7d142fbc3 100644 --- a/tests/mir-opt/issue_62289.rs +++ b/tests/mir-opt/issue_62289.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // check that we don't forget to drop the Box if we early return before // initializing it // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/issue_72181.rs b/tests/mir-opt/issue_72181.rs index dea8ecbd3ec7b..04d273f1c78d9 100644 --- a/tests/mir-opt/issue_72181.rs +++ b/tests/mir-opt/issue_72181.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=1 // Regression test for #72181, this ICE requires `-Z mir-opt-level=1` flags. diff --git a/tests/mir-opt/issue_72181_1.rs b/tests/mir-opt/issue_72181_1.rs index 5c8346166aec0..1e7c70c449d98 100644 --- a/tests/mir-opt/issue_72181_1.rs +++ b/tests/mir-opt/issue_72181_1.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=1 // Regression test for #72181, this ICE requires `-Z mir-opt-level=1` flags. diff --git a/tests/mir-opt/issue_76432.rs b/tests/mir-opt/issue_76432.rs index 6d884063caafb..f881b75e78f88 100644 --- a/tests/mir-opt/issue_76432.rs +++ b/tests/mir-opt/issue_76432.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Check that we do not insert StorageDead at each target if StorageDead was never seen diff --git a/tests/mir-opt/issue_78192.rs b/tests/mir-opt/issue_78192.rs index a82f0e3a6653a..675f1d85f4e42 100644 --- a/tests/mir-opt/issue_78192.rs +++ b/tests/mir-opt/issue_78192.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=1 -Zinline-mir pub fn f(a: &T) -> *const T { let b: &*const T = &(a as *const T); diff --git a/tests/mir-opt/issue_91633.rs b/tests/mir-opt/issue_91633.rs index d24c2e19aa732..3922ccc422848 100644 --- a/tests/mir-opt/issue_91633.rs +++ b/tests/mir-opt/issue_91633.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=0 // EMIT_MIR issue_91633.hey.built.after.mir fn hey(it: &[T]) diff --git a/tests/mir-opt/issue_99325.rs b/tests/mir-opt/issue_99325.rs index 4cee4f20b31b3..6e108cd27a6ca 100644 --- a/tests/mir-opt/issue_99325.rs +++ b/tests/mir-opt/issue_99325.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_BIT_WIDTH #![feature(adt_const_params, unsized_const_params)] diff --git a/tests/mir-opt/loop_test.rs b/tests/mir-opt/loop_test.rs index bc9b659610702..fd8c7829e2a82 100644 --- a/tests/mir-opt/loop_test.rs +++ b/tests/mir-opt/loop_test.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z identify_regions // Tests to make sure we correctly generate falseUnwind edges in loops diff --git a/tests/mir-opt/match_arm_scopes.rs b/tests/mir-opt/match_arm_scopes.rs index 43746e993985f..2de70fed3a467 100644 --- a/tests/mir-opt/match_arm_scopes.rs +++ b/tests/mir-opt/match_arm_scopes.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Test that StorageDead and Drops are generated properly for bindings in // matches: diff --git a/tests/mir-opt/matches_u8.rs b/tests/mir-opt/matches_u8.rs index 86d6462567428..b7e839ebd3b17 100644 --- a/tests/mir-opt/matches_u8.rs +++ b/tests/mir-opt/matches_u8.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: MatchBranchSimplification // EMIT_MIR matches_u8.exhaustive_match.MatchBranchSimplification.diff diff --git a/tests/mir-opt/multiple_return_terminators.rs b/tests/mir-opt/multiple_return_terminators.rs index 8d83082a829eb..25cccd3bd696e 100644 --- a/tests/mir-opt/multiple_return_terminators.rs +++ b/tests/mir-opt/multiple_return_terminators.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Z mir-opt-level=4 // EMIT_MIR multiple_return_terminators.test.MultipleReturnTerminators.diff diff --git a/tests/mir-opt/nll/named_lifetimes_basic.rs b/tests/mir-opt/nll/named_lifetimes_basic.rs index 93f4a8bfd598a..71faf4e9e0ac9 100644 --- a/tests/mir-opt/nll/named_lifetimes_basic.rs +++ b/tests/mir-opt/nll/named_lifetimes_basic.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Basic test for named lifetime translation. Check that we // instantiate the types that appear in function arguments with // suitable variables and that we setup the outlives relationship diff --git a/tests/mir-opt/nll/region_subtyping_basic.rs b/tests/mir-opt/nll/region_subtyping_basic.rs index ee74f7af2eb73..95491640ef08c 100644 --- a/tests/mir-opt/nll/region_subtyping_basic.rs +++ b/tests/mir-opt/nll/region_subtyping_basic.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Basic test for liveness constraints: the region (`R1`) that appears // in the type of `p` includes the points after `&v[0]` up to (but not // including) the call to `use_x`. The `else` branch is not included. diff --git a/tests/mir-opt/no_drop_for_inactive_variant.rs b/tests/mir-opt/no_drop_for_inactive_variant.rs index c94b36971ca2e..2aa832fbec13d 100644 --- a/tests/mir-opt/no_drop_for_inactive_variant.rs +++ b/tests/mir-opt/no_drop_for_inactive_variant.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Ensure that there are no drop terminators in `unwrap` (except the one along the cleanup diff --git a/tests/mir-opt/no_spurious_drop_after_call.rs b/tests/mir-opt/no_spurious_drop_after_call.rs index cd7b8fb79425a..40377ad2aaf74 100644 --- a/tests/mir-opt/no_spurious_drop_after_call.rs +++ b/tests/mir-opt/no_spurious_drop_after_call.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Test that after the call to `std::mem::drop` we do not generate a diff --git a/tests/mir-opt/or_pattern.rs b/tests/mir-opt/or_pattern.rs index 0ad0ce8ead1e2..df375aed3d5b9 100644 --- a/tests/mir-opt/or_pattern.rs +++ b/tests/mir-opt/or_pattern.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir fn shortcut_second_or() { diff --git a/tests/mir-opt/packed_struct_drop_aligned.rs b/tests/mir-opt/packed_struct_drop_aligned.rs index 3abc6426e7f0c..455a3cb15b295 100644 --- a/tests/mir-opt/packed_struct_drop_aligned.rs +++ b/tests/mir-opt/packed_struct_drop_aligned.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR packed_struct_drop_aligned.main.SimplifyCfg-pre-optimizations.after.mir diff --git a/tests/mir-opt/pre-codegen/chained_comparison.rs b/tests/mir-opt/pre-codegen/chained_comparison.rs index 4869f1e01a028..8c359bda143a1 100644 --- a/tests/mir-opt/pre-codegen/chained_comparison.rs +++ b/tests/mir-opt/pre-codegen/chained_comparison.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs b/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs index 561bafa96516d..58e59686de7f9 100644 --- a/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs +++ b/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=0 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/intrinsics.rs b/tests/mir-opt/pre-codegen/intrinsics.rs index 0482b85e95f8a..42200e0b87fcd 100644 --- a/tests/mir-opt/pre-codegen/intrinsics.rs +++ b/tests/mir-opt/pre-codegen/intrinsics.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // Checks that we do not have any branches in the MIR for the two tested functions. diff --git a/tests/mir-opt/pre-codegen/loops.rs b/tests/mir-opt/pre-codegen/loops.rs index 952dd8cac60fd..281595f165bed 100644 --- a/tests/mir-opt/pre-codegen/loops.rs +++ b/tests/mir-opt/pre-codegen/loops.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -g //@ ignore-std-debug-assertions (debug assertions result in different inlines) //@ needs-unwind diff --git a/tests/mir-opt/pre-codegen/mem_replace.rs b/tests/mir-opt/pre-codegen/mem_replace.rs index be23dcdb22ae5..750a7907c15ef 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.rs +++ b/tests/mir-opt/pre-codegen/mem_replace.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -Zinline-mir //@ ignore-std-debug-assertions // Reason: precondition checks on ptr::read/write are under cfg(debug_assertions) diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs index 44b4b0ad888a5..6fb71bda9b441 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ compile-flags: -C overflow-checks=on -Zdump-mir-exclude-alloc-bytes diff --git a/tests/mir-opt/pre-codegen/ptr_offset.rs b/tests/mir-opt/pre-codegen/ptr_offset.rs index 120be99fc94af..1e936222a2dd3 100644 --- a/tests/mir-opt/pre-codegen/ptr_offset.rs +++ b/tests/mir-opt/pre-codegen/ptr_offset.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -Zinline-mir //@ ignore-std-debug-assertions (precondition checks are under cfg(debug_assertions)) // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/range_iter.rs b/tests/mir-opt/pre-codegen/range_iter.rs index 5aa617227ce6b..856d57cd6e4f8 100644 --- a/tests/mir-opt/pre-codegen/range_iter.rs +++ b/tests/mir-opt/pre-codegen/range_iter.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/slice_filter.rs b/tests/mir-opt/pre-codegen/slice_filter.rs index 35881ff2b18c6..a6f4a52075dff 100644 --- a/tests/mir-opt/pre-codegen/slice_filter.rs +++ b/tests/mir-opt/pre-codegen/slice_filter.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/slice_iter.rs b/tests/mir-opt/pre-codegen/slice_iter.rs index 46ded729852ab..f9049c79803ea 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.rs +++ b/tests/mir-opt/pre-codegen/slice_iter.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 //@ only-64bit (constants for `None::<&T>` show in the output) //@ ignore-std-debug-assertions (precondition checks on ptr::add are under cfg(debug_assertions)) diff --git a/tests/mir-opt/pre-codegen/spans.rs b/tests/mir-opt/pre-codegen/spans.rs index 940089d2d498c..51aad44579dae 100644 --- a/tests/mir-opt/pre-codegen/spans.rs +++ b/tests/mir-opt/pre-codegen/spans.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that the comments we emit in MIR opts are accurate. // // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/try_identity.rs b/tests/mir-opt/pre-codegen/try_identity.rs index 264b303e381d3..876f86fe52ba7 100644 --- a/tests/mir-opt/pre-codegen/try_identity.rs +++ b/tests/mir-opt/pre-codegen/try_identity.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 // Track the status of MIR optimizations simplifying `Ok(res?)` for both the old and new desugarings diff --git a/tests/mir-opt/pre-codegen/vec_deref.rs b/tests/mir-opt/pre-codegen/vec_deref.rs index 3476e1760c0a8..75edd9bd87948 100644 --- a/tests/mir-opt/pre-codegen/vec_deref.rs +++ b/tests/mir-opt/pre-codegen/vec_deref.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/remove_fake_borrows.rs b/tests/mir-opt/remove_fake_borrows.rs index 21c7b46ee1a35..c69fdaf125525 100644 --- a/tests/mir-opt/remove_fake_borrows.rs +++ b/tests/mir-opt/remove_fake_borrows.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that the fake borrows for matches are removed after borrow checking. // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/remove_never_const.rs b/tests/mir-opt/remove_never_const.rs index 81562058d808f..9307b8e760508 100644 --- a/tests/mir-opt/remove_never_const.rs +++ b/tests/mir-opt/remove_never_const.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // This was originally a regression test for #66975 - ensure that we do not generate never typed // consts in codegen. We also have tests for this that catches the error, see // tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs. diff --git a/tests/mir-opt/retag.rs b/tests/mir-opt/retag.rs index 001c559913839..11bdc5b973f9b 100644 --- a/tests/mir-opt/retag.rs +++ b/tests/mir-opt/retag.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: AddRetag // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // ignore-tidy-linelength diff --git a/tests/mir-opt/return_an_array.rs b/tests/mir-opt/return_an_array.rs index 673b5df7d7303..2af48ae6a5b97 100644 --- a/tests/mir-opt/return_an_array.rs +++ b/tests/mir-opt/return_an_array.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // this tests move up progration, which is not yet implemented fn foo() -> [u8; 1024] { diff --git a/tests/mir-opt/separate_const_switch.rs b/tests/mir-opt/separate_const_switch.rs index 0583594298026..245a47a6ecca2 100644 --- a/tests/mir-opt/separate_const_switch.rs +++ b/tests/mir-opt/separate_const_switch.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck #![feature(try_trait_v2)] //@ compile-flags: -Zunsound-mir-opts diff --git a/tests/mir-opt/simplify_cfg.rs b/tests/mir-opt/simplify_cfg.rs index b1fdc5e64a0e2..8895103852472 100644 --- a/tests/mir-opt/simplify_cfg.rs +++ b/tests/mir-opt/simplify_cfg.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that the goto chain starting from bb0 is collapsed. //@ compile-flags: -Cpanic=abort //@ no-prefer-dynamic diff --git a/tests/mir-opt/simplify_locals.rs b/tests/mir-opt/simplify_locals.rs index 6511b5e87e479..f0c442bd0c1a1 100644 --- a/tests/mir-opt/simplify_locals.rs +++ b/tests/mir-opt/simplify_locals.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: SimplifyLocals-before-const-prop #![feature(thread_local)] diff --git a/tests/mir-opt/simplify_locals_removes_unused_consts.rs b/tests/mir-opt/simplify_locals_removes_unused_consts.rs index 70d1555e786bc..424b25c2b745d 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_consts.rs +++ b/tests/mir-opt/simplify_locals_removes_unused_consts.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ test-mir-pass: SimplifyLocals-before-const-prop //@ compile-flags: -C overflow-checks=no diff --git a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs index 6257f5ee795ac..327c7bd6ad129 100644 --- a/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs +++ b/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ test-mir-pass: SimplifyLocals-before-const-prop fn map(x: Option>) -> Option> { diff --git a/tests/mir-opt/slice_drop_shim.rs b/tests/mir-opt/slice_drop_shim.rs index f34c34855a169..b8ae44ef68214 100644 --- a/tests/mir-opt/slice_drop_shim.rs +++ b/tests/mir-opt/slice_drop_shim.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ compile-flags: -Zmir-opt-level=0 -Clink-dead-code // mir-opt tests are always built as rlibs so that they seamlessly cross-compile, // so this test only produces MIR for the drop_in_place we're looking for diff --git a/tests/mir-opt/ssa_unreachable_116212.rs b/tests/mir-opt/ssa_unreachable_116212.rs index 9f1cf223e2635..f8550556f54d0 100644 --- a/tests/mir-opt/ssa_unreachable_116212.rs +++ b/tests/mir-opt/ssa_unreachable_116212.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Regression test for issue #116212. #![feature(never_type)] diff --git a/tests/mir-opt/storage_ranges.rs b/tests/mir-opt/storage_ranges.rs index 5a68d56846540..49f4fdf589132 100644 --- a/tests/mir-opt/storage_ranges.rs +++ b/tests/mir-opt/storage_ranges.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR storage_ranges.main.nll.0.mir fn main() { diff --git a/tests/mir-opt/switch_to_self.rs b/tests/mir-opt/switch_to_self.rs index 51a7c13494fb4..0e963834305d3 100644 --- a/tests/mir-opt/switch_to_self.rs +++ b/tests/mir-opt/switch_to_self.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that MatchBranchSimplification doesn't ICE on a SwitchInt where // one of the targets is the block that the SwitchInt terminates. #![crate_type = "lib"] diff --git a/tests/mir-opt/tail_call_drops.rs b/tests/mir-opt/tail_call_drops.rs index 56f4852a95f4b..f58623465a1ec 100644 --- a/tests/mir-opt/tail_call_drops.rs +++ b/tests/mir-opt/tail_call_drops.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![allow(incomplete_features)] #![feature(explicit_tail_calls)] diff --git a/tests/mir-opt/tail_expr_drop_order_unwind.rs b/tests/mir-opt/tail_expr_drop_order_unwind.rs index 065e08c340963..49283a433f7c6 100644 --- a/tests/mir-opt/tail_expr_drop_order_unwind.rs +++ b/tests/mir-opt/tail_expr_drop_order_unwind.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.mir diff --git a/tests/mir-opt/tls_access.rs b/tests/mir-opt/tls_access.rs index 3dfc85def99e0..465282e1a2e7a 100644 --- a/tests/mir-opt/tls_access.rs +++ b/tests/mir-opt/tls_access.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // EMIT_MIR tls_access.main.PreCodegen.after.mir //@ compile-flags: -Zmir-opt-level=0 diff --git a/tests/mir-opt/uninhabited_enum.rs b/tests/mir-opt/uninhabited_enum.rs index 124693c0fe2cc..2ef76449e3cc3 100644 --- a/tests/mir-opt/uninhabited_enum.rs +++ b/tests/mir-opt/uninhabited_enum.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // // check that we mark blocks with `!` locals as unreachable. // (and currently don't do the same for other uninhabited types) diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.rs b/tests/mir-opt/uninhabited_fallthrough_elimination.rs index 537935d8ae433..a89f160a5f092 100644 --- a/tests/mir-opt/uninhabited_fallthrough_elimination.rs +++ b/tests/mir-opt/uninhabited_fallthrough_elimination.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck enum Empty {} enum S { diff --git a/tests/mir-opt/uninhabited_not_read.rs b/tests/mir-opt/uninhabited_not_read.rs index 4c80f5e55c684..c1598d0301f67 100644 --- a/tests/mir-opt/uninhabited_not_read.rs +++ b/tests/mir-opt/uninhabited_not_read.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck //@ edition: 2021 // In ed 2021 and below, we fallback `!` to `()`. diff --git a/tests/mir-opt/unusual_item_types.rs b/tests/mir-opt/unusual_item_types.rs index 2f05981e812eb..77174fdd2fee9 100644 --- a/tests/mir-opt/unusual_item_types.rs +++ b/tests/mir-opt/unusual_item_types.rs @@ -1,4 +1,4 @@ -// skip-filecheck +//@ skip-filecheck // Test that we don't ICE when trying to dump MIR for unusual item types and // that we don't create filenames containing `<` and `>` //@ compile-flags: -Zmir-opt-level=0 diff --git a/tests/pretty/fn-variadic.rs b/tests/pretty/fn-variadic.rs index e11ec9bcdcbbf..88eecee6e380e 100644 --- a/tests/pretty/fn-variadic.rs +++ b/tests/pretty/fn-variadic.rs @@ -9,7 +9,7 @@ extern "C" { } pub unsafe extern "C" fn bar(_: i32, mut ap: ...) -> usize { - ap.arg::() + ap.next_arg::() } fn main() {} diff --git a/tests/pretty/hir-fn-variadic.pp b/tests/pretty/hir-fn-variadic.pp index 30423349241b7..50ad30f7cc6cd 100644 --- a/tests/pretty/hir-fn-variadic.pp +++ b/tests/pretty/hir-fn-variadic.pp @@ -11,7 +11,8 @@ unsafe fn foo(x: i32, va1: ...); } -unsafe extern "C" fn bar(_: i32, mut va2: ...) -> usize { va2.arg::() } +unsafe extern "C" fn bar(_: i32, mut va2: ...) + -> usize { va2.next_arg::() } fn main() { fn g1(_: extern "C" fn(_: u8, va: ...)) { } diff --git a/tests/pretty/hir-fn-variadic.rs b/tests/pretty/hir-fn-variadic.rs index ce1b0f835ab27..4daf8d9aeb525 100644 --- a/tests/pretty/hir-fn-variadic.rs +++ b/tests/pretty/hir-fn-variadic.rs @@ -9,7 +9,7 @@ extern "C" { } pub unsafe extern "C" fn bar(_: i32, mut va2: ...) -> usize { - va2.arg::() + va2.next_arg::() } fn main() { @@ -21,9 +21,17 @@ fn main() { fn g5(_: extern "C" fn(va: ...)) {} fn g6(_: extern "C" fn(_: ...)) {} - _ = { unsafe extern "C" fn f1(_: u8, va: ...) {} }; - _ = { unsafe extern "C" fn f2(_: u8, _: ...) {} }; + _ = { + unsafe extern "C" fn f1(_: u8, va: ...) {} + }; + _ = { + unsafe extern "C" fn f2(_: u8, _: ...) {} + }; - _ = { unsafe extern "C" fn f5(va: ...) {} }; - _ = { unsafe extern "C" fn f6(_: ...) {} }; + _ = { + unsafe extern "C" fn f5(va: ...) {} + }; + _ = { + unsafe extern "C" fn f6(_: ...) {} + }; } diff --git a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs index 109fbb1c62036..f3d82474e94aa 100644 --- a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs +++ b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs @@ -17,59 +17,59 @@ unsafe fn compare_c_str(ptr: *const c_char, val: &CStr) -> bool { #[unsafe(no_mangle)] pub unsafe extern "C" fn check_list_0(mut ap: VaList) -> usize { - continue_if!(ap.arg::() == 1); - continue_if!(ap.arg::() == 2); - continue_if!(ap.arg::() == 3); + continue_if!(ap.next_arg::() == 1); + continue_if!(ap.next_arg::() == 2); + continue_if!(ap.next_arg::() == 3); 0 } #[unsafe(no_mangle)] pub unsafe extern "C" fn check_list_1(mut ap: VaList) -> usize { - continue_if!(ap.arg::() == -1); - continue_if!(ap.arg::() == 'A' as c_int); - continue_if!(ap.arg::() == '4' as c_int); - continue_if!(ap.arg::() == ';' as c_int); - continue_if!(ap.arg::() == 0x32); - continue_if!(ap.arg::() == 0x10000001); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), c"Valid!")); + continue_if!(ap.next_arg::() == -1); + continue_if!(ap.next_arg::() == 'A' as c_int); + continue_if!(ap.next_arg::() == '4' as c_int); + continue_if!(ap.next_arg::() == ';' as c_int); + continue_if!(ap.next_arg::() == 0x32); + continue_if!(ap.next_arg::() == 0x10000001); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), c"Valid!")); 0 } #[unsafe(no_mangle)] pub unsafe extern "C" fn check_list_2(mut ap: VaList) -> usize { - continue_if!(ap.arg::() == 3.14); - continue_if!(ap.arg::() == 12); - continue_if!(ap.arg::() == 'a' as c_int); - continue_if!(ap.arg::() == 6.28); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), c"Hello")); - continue_if!(ap.arg::() == 42); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), c"World")); + continue_if!(ap.next_arg::() == 3.14); + continue_if!(ap.next_arg::() == 12); + continue_if!(ap.next_arg::() == 'a' as c_int); + continue_if!(ap.next_arg::() == 6.28); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), c"Hello")); + continue_if!(ap.next_arg::() == 42); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), c"World")); 0 } #[unsafe(no_mangle)] pub unsafe extern "C" fn check_list_copy_0(mut ap: VaList) -> usize { - continue_if!(ap.arg::() == 6.28); - continue_if!(ap.arg::() == 16); - continue_if!(ap.arg::() == 'A' as c_int); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), c"Skip Me!")); + continue_if!(ap.next_arg::() == 6.28); + continue_if!(ap.next_arg::() == 16); + continue_if!(ap.next_arg::() == 'A' as c_int); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), c"Skip Me!")); let mut ap = ap.clone(); - if compare_c_str(ap.arg::<*const c_char>(), c"Correct") { 0 } else { 0xff } + if compare_c_str(ap.next_arg::<*const c_char>(), c"Correct") { 0 } else { 0xff } } #[unsafe(no_mangle)] pub unsafe extern "C" fn check_varargs_0(_: c_int, mut ap: ...) -> usize { - continue_if!(ap.arg::() == 42); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), c"Hello, World!")); + continue_if!(ap.next_arg::() == 42); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), c"Hello, World!")); 0 } #[unsafe(no_mangle)] pub unsafe extern "C" fn check_varargs_1(_: c_int, mut ap: ...) -> usize { - continue_if!(ap.arg::() == 3.14); - continue_if!(ap.arg::() == 12); - continue_if!(ap.arg::() == 'A' as c_int); - continue_if!(ap.arg::() == 1); + continue_if!(ap.next_arg::() == 3.14); + continue_if!(ap.next_arg::() == 12); + continue_if!(ap.next_arg::() == 'A' as c_int); + continue_if!(ap.next_arg::() == 1); 0 } @@ -80,65 +80,65 @@ pub unsafe extern "C" fn check_varargs_2(_: c_int, _ap: ...) -> usize { #[unsafe(no_mangle)] pub unsafe extern "C" fn check_varargs_3(_: c_int, mut ap: ...) -> usize { - continue_if!(ap.arg::() == 1); - continue_if!(ap.arg::() == 2); - continue_if!(ap.arg::() == 3); - continue_if!(ap.arg::() == 4); - continue_if!(ap.arg::() == 5); - continue_if!(ap.arg::() == 6); - continue_if!(ap.arg::() == 7); - continue_if!(ap.arg::() == 8); - continue_if!(ap.arg::() == 9); - continue_if!(ap.arg::() == 10); + continue_if!(ap.next_arg::() == 1); + continue_if!(ap.next_arg::() == 2); + continue_if!(ap.next_arg::() == 3); + continue_if!(ap.next_arg::() == 4); + continue_if!(ap.next_arg::() == 5); + continue_if!(ap.next_arg::() == 6); + continue_if!(ap.next_arg::() == 7); + continue_if!(ap.next_arg::() == 8); + continue_if!(ap.next_arg::() == 9); + continue_if!(ap.next_arg::() == 10); 0 } #[unsafe(no_mangle)] pub unsafe extern "C" fn check_varargs_4(_: c_double, mut ap: ...) -> usize { - continue_if!(ap.arg::() == 1.0); - continue_if!(ap.arg::() == 2.0); - continue_if!(ap.arg::() == 3.0); - continue_if!(ap.arg::() == 4.0); - continue_if!(ap.arg::() == 5.0); - continue_if!(ap.arg::() == 6.0); - continue_if!(ap.arg::() == 7.0); - continue_if!(ap.arg::() == 8.0); - continue_if!(ap.arg::() == 9.0); - continue_if!(ap.arg::() == 10.0); - continue_if!(ap.arg::() == 11.0); - continue_if!(ap.arg::() == 12.0); - continue_if!(ap.arg::() == 13.0); + continue_if!(ap.next_arg::() == 1.0); + continue_if!(ap.next_arg::() == 2.0); + continue_if!(ap.next_arg::() == 3.0); + continue_if!(ap.next_arg::() == 4.0); + continue_if!(ap.next_arg::() == 5.0); + continue_if!(ap.next_arg::() == 6.0); + continue_if!(ap.next_arg::() == 7.0); + continue_if!(ap.next_arg::() == 8.0); + continue_if!(ap.next_arg::() == 9.0); + continue_if!(ap.next_arg::() == 10.0); + continue_if!(ap.next_arg::() == 11.0); + continue_if!(ap.next_arg::() == 12.0); + continue_if!(ap.next_arg::() == 13.0); 0 } #[unsafe(no_mangle)] pub unsafe extern "C" fn check_varargs_5(_: c_int, mut ap: ...) -> usize { - continue_if!(ap.arg::() == 1.0); - continue_if!(ap.arg::() == 1); - continue_if!(ap.arg::() == 2.0); - continue_if!(ap.arg::() == 2); - continue_if!(ap.arg::() == 3.0); - continue_if!(ap.arg::() == 3); - continue_if!(ap.arg::() == 4.0); - continue_if!(ap.arg::() == 4); - continue_if!(ap.arg::() == 5); - continue_if!(ap.arg::() == 5.0); - continue_if!(ap.arg::() == 6); - continue_if!(ap.arg::() == 6.0); - continue_if!(ap.arg::() == 7); - continue_if!(ap.arg::() == 7.0); - continue_if!(ap.arg::() == 8); - continue_if!(ap.arg::() == 8.0); - continue_if!(ap.arg::() == 9); - continue_if!(ap.arg::() == 9.0); - continue_if!(ap.arg::() == 10); - continue_if!(ap.arg::() == 10.0); - continue_if!(ap.arg::() == 11); - continue_if!(ap.arg::() == 11.0); - continue_if!(ap.arg::() == 12); - continue_if!(ap.arg::() == 12.0); - continue_if!(ap.arg::() == 13); - continue_if!(ap.arg::() == 13.0); + continue_if!(ap.next_arg::() == 1.0); + continue_if!(ap.next_arg::() == 1); + continue_if!(ap.next_arg::() == 2.0); + continue_if!(ap.next_arg::() == 2); + continue_if!(ap.next_arg::() == 3.0); + continue_if!(ap.next_arg::() == 3); + continue_if!(ap.next_arg::() == 4.0); + continue_if!(ap.next_arg::() == 4); + continue_if!(ap.next_arg::() == 5); + continue_if!(ap.next_arg::() == 5.0); + continue_if!(ap.next_arg::() == 6); + continue_if!(ap.next_arg::() == 6.0); + continue_if!(ap.next_arg::() == 7); + continue_if!(ap.next_arg::() == 7.0); + continue_if!(ap.next_arg::() == 8); + continue_if!(ap.next_arg::() == 8.0); + continue_if!(ap.next_arg::() == 9); + continue_if!(ap.next_arg::() == 9.0); + continue_if!(ap.next_arg::() == 10); + continue_if!(ap.next_arg::() == 10.0); + continue_if!(ap.next_arg::() == 11); + continue_if!(ap.next_arg::() == 11.0); + continue_if!(ap.next_arg::() == 12); + continue_if!(ap.next_arg::() == 12.0); + continue_if!(ap.next_arg::() == 13); + continue_if!(ap.next_arg::() == 13.0); 0 } diff --git a/tests/ui/abi/variadic-ffi.rs b/tests/ui/abi/variadic-ffi.rs index 3ffa0bea0ecf8..42ff8d0dbb36e 100644 --- a/tests/ui/abi/variadic-ffi.rs +++ b/tests/ui/abi/variadic-ffi.rs @@ -28,20 +28,20 @@ pub unsafe extern "C" fn test_va_copy(_: u64, mut ap: ...) { // Advance one pair in the copy before checking let mut ap2 = ap.clone(); - let _ = ap2.arg::(); - let _ = ap2.arg::(); + let _ = ap2.next_arg::(); + let _ = ap2.next_arg::(); assert_eq!(rust_valist_interesting_average(2, ap2) as i64, 50); // Advance one pair in the original - let _ = ap.arg::(); - let _ = ap.arg::(); + let _ = ap.next_arg::(); + let _ = ap.next_arg::(); let ap2 = ap.clone(); assert_eq!(rust_valist_interesting_average(2, ap2) as i64, 50); let mut ap2 = ap.clone(); - let _ = ap2.arg::(); - let _ = ap2.arg::(); + let _ = ap2.next_arg::(); + let _ = ap2.next_arg::(); assert_eq!(rust_valist_interesting_average(2, ap2) as i64, 70); } diff --git a/tests/ui/associated-inherent-types/next-solver-opaque-inherent-fn-ptr-issue-155204.rs b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-fn-ptr-issue-155204.rs new file mode 100644 index 0000000000000..38539153c2605 --- /dev/null +++ b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-fn-ptr-issue-155204.rs @@ -0,0 +1,18 @@ +//! Regression test for +//@compile-flags: -Znext-solver=globally +#![feature(inherent_associated_types)] +pub struct Windows {} +//~^ ERROR type parameter `T` is never used + +impl Windows { + //~^ ERROR the type parameter `T` is not constrained by the impl trait, self type, or predicates + type AssocType = impl Send; + //~^ ERROR `impl Trait` in associated types is unstable + //~| ERROR unconstrained opaque type + fn ret(&self) -> Self::AssocType { + //~^ ERROR type annotations needed + () + //~^ ERROR mismatched types + } +} +//~^ ERROR `main` function not found diff --git a/tests/ui/associated-inherent-types/next-solver-opaque-inherent-fn-ptr-issue-155204.stderr b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-fn-ptr-issue-155204.stderr new file mode 100644 index 0000000000000..8974ed53bc0fa --- /dev/null +++ b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-fn-ptr-issue-155204.stderr @@ -0,0 +1,63 @@ +error[E0658]: `impl Trait` in associated types is unstable + --> $DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs:9:22 + | +LL | type AssocType = impl Send; + | ^^^^^^^^^ + | + = note: see issue #63063 for more information + = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0601]: `main` function not found in crate `next_solver_opaque_inherent_fn_ptr_issue_155204` + --> $DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs:17:2 + | +LL | } + | ^ consider adding a `main` function to `$DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs` + +error[E0392]: type parameter `T` is never used + --> $DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs:4:20 + | +LL | pub struct Windows {} + | ^ unused type parameter + | + = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` + = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead + +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs:7:6 + | +LL | impl Windows { + | ^ unconstrained type parameter + +error[E0282]: type annotations needed + --> $DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs:12:22 + | +LL | fn ret(&self) -> Self::AssocType { + | ^^^^^^^^^^^^^^^ cannot infer type + +error: unconstrained opaque type + --> $DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs:9:22 + | +LL | type AssocType = impl Send; + | ^^^^^^^^^ + | + = note: `AssocType` must be used in combination with a concrete type within the same impl + +error[E0308]: mismatched types + --> $DIR/next-solver-opaque-inherent-fn-ptr-issue-155204.rs:14:9 + | +LL | fn ret(&self) -> Self::AssocType { + | --------------- expected `Windows fn(&'a ())>::AssocType` because of return type +LL | +LL | () + | ^^ types differ + | + = note: expected associated type `Windows fn(&'a ())>::AssocType` + found unit type `()` + = help: consider constraining the associated type `Windows fn(&'a ())>::AssocType` to `()` or calling a method that returns `Windows fn(&'a ())>::AssocType` + = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html + +error: aborting due to 7 previous errors + +Some errors have detailed explanations: E0207, E0282, E0308, E0392, E0601, E0658. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/associated-inherent-types/next-solver-opaque-inherent-no-ice.rs b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-no-ice.rs new file mode 100644 index 0000000000000..8ffdb3f60da9e --- /dev/null +++ b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-no-ice.rs @@ -0,0 +1,17 @@ +//! Regression test for +//@compile-flags: -Znext-solver=globally +#![feature(inherent_associated_types)] + +struct Foo; +impl Foo { + //~^ ERROR the const parameter `X` is not constrained by the impl trait, self type, or predicates + //~| ERROR cannot find type `y` in this scope + type ImplTrait = impl Clone; + //~^ ERROR `impl Trait` in associated types is unstable + //~| ERROR unconstrained opaque type + fn f() -> Self::ImplTrait { + () + //~^ ERROR mismatched types + } +} +//~^ ERROR `main` function not found diff --git a/tests/ui/associated-inherent-types/next-solver-opaque-inherent-no-ice.stderr b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-no-ice.stderr new file mode 100644 index 0000000000000..03f369359c0d8 --- /dev/null +++ b/tests/ui/associated-inherent-types/next-solver-opaque-inherent-no-ice.stderr @@ -0,0 +1,56 @@ +error[E0425]: cannot find type `y` in this scope + --> $DIR/next-solver-opaque-inherent-no-ice.rs:6:15 + | +LL | impl Foo { + | ^ not found in this scope + +error[E0658]: `impl Trait` in associated types is unstable + --> $DIR/next-solver-opaque-inherent-no-ice.rs:9:22 + | +LL | type ImplTrait = impl Clone; + | ^^^^^^^^^^ + | + = note: see issue #63063 for more information + = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0601]: `main` function not found in crate `next_solver_opaque_inherent_no_ice` + --> $DIR/next-solver-opaque-inherent-no-ice.rs:16:2 + | +LL | } + | ^ consider adding a `main` function to `$DIR/next-solver-opaque-inherent-no-ice.rs` + +error[E0207]: the const parameter `X` is not constrained by the impl trait, self type, or predicates + --> $DIR/next-solver-opaque-inherent-no-ice.rs:6:6 + | +LL | impl Foo { + | ^^^^^^^^^^ unconstrained const parameter + | + = note: expressions using a const parameter must map each value to a distinct output value + = note: proving the result of expressions other than the parameter are unique is not supported + +error: unconstrained opaque type + --> $DIR/next-solver-opaque-inherent-no-ice.rs:9:22 + | +LL | type ImplTrait = impl Clone; + | ^^^^^^^^^^ + | + = note: `ImplTrait` must be used in combination with a concrete type within the same impl + +error[E0308]: mismatched types + --> $DIR/next-solver-opaque-inherent-no-ice.rs:13:9 + | +LL | fn f() -> Self::ImplTrait { + | --------------- expected `Foo::ImplTrait` because of return type +LL | () + | ^^ types differ + | + = note: expected associated type `Foo::ImplTrait` + found unit type `()` + = help: consider constraining the associated type `Foo::ImplTrait` to `()` or calling a method that returns `Foo::ImplTrait` + = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0207, E0308, E0425, E0601, E0658. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/c-variadic/copy.rs b/tests/ui/c-variadic/copy.rs index e9171738aa157..5f3ec25581c9e 100644 --- a/tests/ui/c-variadic/copy.rs +++ b/tests/ui/c-variadic/copy.rs @@ -13,12 +13,12 @@ fn main() { unsafe extern "C" fn variadic(mut ap1: ...) { let mut ap2 = ap1.clone(); - assert_eq!(ap1.arg::(), 1); - assert_eq!(ap2.arg::(), 1); + assert_eq!(ap1.next_arg::(), 1); + assert_eq!(ap2.next_arg::(), 1); - assert_eq!(ap2.arg::(), 2); - assert_eq!(ap1.arg::(), 2); + assert_eq!(ap2.next_arg::(), 2); + assert_eq!(ap1.next_arg::(), 2); drop(ap1); - assert_eq!(ap2.arg::(), 3); + assert_eq!(ap2.next_arg::(), 3); } diff --git a/tests/ui/c-variadic/inherent-method.rs b/tests/ui/c-variadic/inherent-method.rs index c5256aaa1fea3..c71e57816c824 100644 --- a/tests/ui/c-variadic/inherent-method.rs +++ b/tests/ui/c-variadic/inherent-method.rs @@ -7,23 +7,23 @@ struct S(i32); impl S { unsafe extern "C" fn associated_function(mut ap: ...) -> i32 { - unsafe { ap.arg() } + unsafe { ap.next_arg() } } unsafe extern "C" fn method_owned(self, mut ap: ...) -> i32 { - self.0 + unsafe { ap.arg::() } + self.0 + unsafe { ap.next_arg::() } } unsafe extern "C" fn method_ref(&self, mut ap: ...) -> i32 { - self.0 + unsafe { ap.arg::() } + self.0 + unsafe { ap.next_arg::() } } unsafe extern "C" fn method_mut(&mut self, mut ap: ...) -> i32 { - self.0 + unsafe { ap.arg::() } + self.0 + unsafe { ap.next_arg::() } } unsafe extern "C" fn fat_pointer(self: Box, mut ap: ...) -> i32 { - self.0 + unsafe { ap.arg::() } + self.0 + unsafe { ap.next_arg::() } } } diff --git a/tests/ui/c-variadic/not-dyn-compatible.rs b/tests/ui/c-variadic/not-dyn-compatible.rs index b40a13e584762..6676cc661c875 100644 --- a/tests/ui/c-variadic/not-dyn-compatible.rs +++ b/tests/ui/c-variadic/not-dyn-compatible.rs @@ -12,7 +12,7 @@ trait Trait { fn get(&self) -> u64; unsafe extern "C" fn dyn_method_ref(&self, mut ap: ...) -> u64 { - self.get() + unsafe { ap.arg::() } + self.get() + unsafe { ap.next_arg::() } } } diff --git a/tests/ui/c-variadic/roundtrip.rs b/tests/ui/c-variadic/roundtrip.rs index b6a858c715dfd..22a545fec5a88 100644 --- a/tests/ui/c-variadic/roundtrip.rs +++ b/tests/ui/c-variadic/roundtrip.rs @@ -10,11 +10,11 @@ use std::ffi::*; #[allow(improper_ctypes_definitions)] const unsafe extern "C" fn variadic(mut ap: ...) -> (T, T) { - let x = ap.arg::(); + let x = ap.next_arg::(); // Intersperse a small type to test alignment logic. A `u32` (i.e. `c_uint`) is the smallest // type that implements `VaArgSafe`: smaller types would automatically be promoted. - assert!(ap.arg::() == 0xAAAA_AAAA); - let y = ap.arg::(); + assert!(ap.next_arg::() == 0xAAAA_AAAA); + let y = ap.next_arg::(); (x, y) } diff --git a/tests/ui/c-variadic/same-program-multiple-abis-arm.rs b/tests/ui/c-variadic/same-program-multiple-abis-arm.rs index fbc5573c5d76c..301485519b9b9 100644 --- a/tests/ui/c-variadic/same-program-multiple-abis-arm.rs +++ b/tests/ui/c-variadic/same-program-multiple-abis-arm.rs @@ -25,8 +25,8 @@ fn main() { // // #[unsafe(no_mangle)] // unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 { -// let b = args.arg::(); -// let c = args.arg::(); +// let b = args.next_arg::(); +// let c = args.next_arg::(); // // a + b + c // } diff --git a/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs b/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs index b54b63289f343..1f6f676780050 100644 --- a/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs +++ b/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs @@ -24,8 +24,8 @@ fn main() { // // #[unsafe(no_mangle)] // unsafe extern "C" fn variadic(a: u32, mut args: ...) -> u32 { -// let b = args.arg::(); -// let c = args.arg::(); +// let b = args.next_arg::(); +// let c = args.next_arg::(); // // a + b + c // } diff --git a/tests/ui/c-variadic/trait-method.rs b/tests/ui/c-variadic/trait-method.rs index 876a303f53ba5..753c0fbe89f22 100644 --- a/tests/ui/c-variadic/trait-method.rs +++ b/tests/ui/c-variadic/trait-method.rs @@ -7,11 +7,11 @@ struct Struct(i32); impl Struct { unsafe extern "C" fn associated_function(mut ap: ...) -> i32 { - unsafe { ap.arg() } + unsafe { ap.next_arg() } } unsafe extern "C" fn method(&self, mut ap: ...) -> i32 { - self.0 + unsafe { ap.arg::() } + self.0 + unsafe { ap.next_arg::() } } } @@ -19,23 +19,23 @@ trait Trait: Sized { fn get(&self) -> i32; unsafe extern "C" fn trait_associated_function(mut ap: ...) -> i32 { - unsafe { ap.arg() } + unsafe { ap.next_arg() } } unsafe extern "C" fn trait_method_owned(self, mut ap: ...) -> i32 { - self.get() + unsafe { ap.arg::() } + self.get() + unsafe { ap.next_arg::() } } unsafe extern "C" fn trait_method_ref(&self, mut ap: ...) -> i32 { - self.get() + unsafe { ap.arg::() } + self.get() + unsafe { ap.next_arg::() } } unsafe extern "C" fn trait_method_mut(&mut self, mut ap: ...) -> i32 { - self.get() + unsafe { ap.arg::() } + self.get() + unsafe { ap.next_arg::() } } unsafe extern "C" fn trait_fat_pointer(self: Box, mut ap: ...) -> i32 { - self.get() + unsafe { ap.arg::() } + self.get() + unsafe { ap.next_arg::() } } } diff --git a/tests/ui/c-variadic/valid.rs b/tests/ui/c-variadic/valid.rs index 8b42eb4932906..2ea50e668d3b2 100644 --- a/tests/ui/c-variadic/valid.rs +++ b/tests/ui/c-variadic/valid.rs @@ -4,16 +4,16 @@ // In rust (and C23 and above) `...` can be the only argument. unsafe extern "C" fn only_dot_dot_dot(mut ap: ...) -> i32 { - unsafe { ap.arg() } + unsafe { ap.next_arg() } } unsafe extern "C-unwind" fn abi_c_unwind(mut ap: ...) -> i32 { - unsafe { ap.arg() } + unsafe { ap.next_arg() } } #[allow(improper_ctypes_definitions)] unsafe extern "C" fn mix_int_float(mut ap: ...) -> (i64, f64, *const i32, f64) { - (ap.arg(), ap.arg(), ap.arg(), ap.arg()) + (ap.next_arg(), ap.next_arg(), ap.next_arg(), ap.next_arg()) } fn main() { diff --git a/tests/ui/consts/const-eval/c-variadic-fail.rs b/tests/ui/consts/const-eval/c-variadic-fail.rs index 2cf5d05cb248f..a394de34a4804 100644 --- a/tests/ui/consts/const-eval/c-variadic-fail.rs +++ b/tests/ui/consts/const-eval/c-variadic-fail.rs @@ -13,7 +13,7 @@ const unsafe extern "C" fn read_n(mut ap: ...) { let mut i = N; while i > 0 { i -= 1; - let _ = ap.arg::(); + let _ = ap.next_arg::(); } } @@ -34,7 +34,7 @@ unsafe fn read_too_many() { } const unsafe extern "C" fn read_as(mut ap: ...) -> T { - ap.arg::() + ap.next_arg::() } unsafe fn read_cast() { @@ -72,7 +72,7 @@ fn use_after_free() { unsafe { let ap = helper(1, 2, 3); let mut ap = std::mem::transmute::<_, VaList>(ap); - ap.arg::(); + ap.next_arg::(); //~^ ERROR memory access failed: ALLOC0 has been freed, so this pointer is dangling [E0080] } }; @@ -82,12 +82,12 @@ fn manual_copy_drop() { const unsafe extern "C" fn helper(ap: ...) { // A copy created using Clone is valid, and can be used to read arguments. let mut copy = ap.clone(); - assert!(copy.arg::() == 1i32); + assert!(copy.next_arg::() == 1i32); let mut copy: VaList = unsafe { std::mem::transmute_copy(&ap) }; // Using the copy is actually fine. - let _ = copy.arg::(); + let _ = copy.next_arg::(); drop(copy); // But then using the original is UB. @@ -103,7 +103,7 @@ fn manual_copy_forget() { let mut copy: VaList = unsafe { std::mem::transmute_copy(&ap) }; // Using the copy is actually fine. - let _ = copy.arg::(); + let _ = copy.next_arg::(); std::mem::forget(copy); // The read (via `copy`) deallocated the original allocation. @@ -119,8 +119,8 @@ fn manual_copy_read() { let mut copy: VaList = unsafe { std::mem::transmute_copy(&ap) }; // Reading from `ap` after reading from `copy` is UB. - let _ = copy.arg::(); - let _ = ap.arg::(); + let _ = copy.next_arg::(); + let _ = ap.next_arg::(); } const { unsafe { helper(1, 2, 3) } }; diff --git a/tests/ui/consts/const-eval/c-variadic-fail.stderr b/tests/ui/consts/const-eval/c-variadic-fail.stderr index 14da5500cb1b6..4b0aed10d7647 100644 --- a/tests/ui/consts/const-eval/c-variadic-fail.stderr +++ b/tests/ui/consts/const-eval/c-variadic-fail.stderr @@ -7,9 +7,9 @@ LL | const { read_n::<1>() } note: inside `read_n::<1>` --> $DIR/c-variadic-fail.rs:16:17 | -LL | let _ = ap.arg::(); - | ^^^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::` +LL | let _ = ap.next_arg::(); + | ^^^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -35,9 +35,9 @@ LL | const { read_n::<2>(1) } note: inside `read_n::<2>` --> $DIR/c-variadic-fail.rs:16:17 | -LL | let _ = ap.arg::(); - | ^^^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::` +LL | let _ = ap.next_arg::(); + | ^^^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -63,9 +63,9 @@ LL | const { read_as::(1i32) }; note: inside `read_as::` --> $DIR/c-variadic-fail.rs:37:5 | -LL | ap.arg::() - | ^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::` +LL | ap.next_arg::() + | ^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -91,9 +91,9 @@ LL | const { read_as::(1u32) }; note: inside `read_as::` --> $DIR/c-variadic-fail.rs:37:5 | -LL | ap.arg::() - | ^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::` +LL | ap.next_arg::() + | ^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -119,9 +119,9 @@ LL | const { read_as::(1u64) }; note: inside `read_as::` --> $DIR/c-variadic-fail.rs:37:5 | -LL | ap.arg::() - | ^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::` +LL | ap.next_arg::() + | ^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -147,9 +147,9 @@ LL | const { read_as::(1i32) }; note: inside `read_as::` --> $DIR/c-variadic-fail.rs:37:5 | -LL | ap.arg::() - | ^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::` +LL | ap.next_arg::() + | ^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -175,9 +175,9 @@ LL | const { read_as::<*const u8>(1i32) }; note: inside `read_as::<*const u8>` --> $DIR/c-variadic-fail.rs:37:5 | -LL | ap.arg::() - | ^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::<*const u8>` +LL | ap.next_arg::() + | ^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::<*const u8>` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -197,10 +197,10 @@ LL | const { read_as::<*const u8>(1i32) }; error[E0080]: memory access failed: ALLOC0 has been freed, so this pointer is dangling --> $DIR/c-variadic-fail.rs:75:13 | -LL | ap.arg::(); - | ^^^^^^^^^^^^^^^ evaluation of `use_after_free::{constant#0}` failed inside this call +LL | ap.next_arg::(); + | ^^^^^^^^^^^^^^^^^^^^ evaluation of `use_after_free::{constant#0}` failed inside this call | -note: inside `VaList::<'_>::arg::` +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered @@ -300,9 +300,9 @@ LL | const { unsafe { helper(1, 2, 3) } }; note: inside `manual_copy_read::helper` --> $DIR/c-variadic-fail.rs:123:17 | -LL | let _ = ap.arg::(); - | ^^^^^^^^^^^^^^^ -note: inside `VaList::<'_>::arg::` +LL | let _ = ap.next_arg::(); + | ^^^^^^^^^^^^^^^^^^^^ +note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered diff --git a/tests/ui/consts/const-eval/c-variadic.rs b/tests/ui/consts/const-eval/c-variadic.rs index 2f8d043fb5db6..b8f02ea8a0848 100644 --- a/tests/ui/consts/const-eval/c-variadic.rs +++ b/tests/ui/consts/const-eval/c-variadic.rs @@ -21,7 +21,7 @@ fn ignores_arguments() { fn echo() { const unsafe extern "C" fn variadic(mut ap: ...) -> i32 { - ap.arg() + ap.next_arg() } assert_eq!(unsafe { variadic(1) }, 1); @@ -35,7 +35,7 @@ fn echo() { fn forward_by_val() { const unsafe fn helper(mut ap: VaList) -> i32 { - ap.arg() + ap.next_arg() } const unsafe extern "C" fn variadic(ap: ...) -> i32 { @@ -53,7 +53,7 @@ fn forward_by_val() { fn forward_by_ref() { const unsafe fn helper(ap: &mut VaList) -> i32 { - ap.arg() + ap.next_arg() } const unsafe extern "C" fn variadic(mut ap: ...) -> i32 { @@ -72,7 +72,7 @@ fn forward_by_ref() { #[allow(improper_ctypes_definitions)] fn nested() { const unsafe fn helper(mut ap1: VaList, mut ap2: VaList) -> (i32, i32) { - (ap1.arg(), ap2.arg()) + (ap1.next_arg(), ap2.next_arg()) } const unsafe extern "C" fn variadic2(ap1: VaList, ap2: ...) -> (i32, i32) { @@ -112,13 +112,13 @@ fn various_types() { } } - continue_if!(ap.arg::().floor() == 3.14f64.floor()); - continue_if!(ap.arg::() == 12); - continue_if!(ap.arg::() == 'a' as c_int); - continue_if!(ap.arg::().floor() == 6.18f64.floor()); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), "Hello")); - continue_if!(ap.arg::() == 42); - continue_if!(compare_c_str(ap.arg::<*const c_char>(), "World")); + continue_if!(ap.next_arg::().floor() == 3.14f64.floor()); + continue_if!(ap.next_arg::() == 12); + continue_if!(ap.next_arg::() == 'a' as c_int); + continue_if!(ap.next_arg::().floor() == 6.18f64.floor()); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), "Hello")); + continue_if!(ap.next_arg::() == 42); + continue_if!(compare_c_str(ap.next_arg::<*const c_char>(), "World")); } unsafe { diff --git a/tests/ui/explicit-tail-calls/c-variadic.rs b/tests/ui/explicit-tail-calls/c-variadic.rs index e6eebe4228e52..affe90c606526 100644 --- a/tests/ui/explicit-tail-calls/c-variadic.rs +++ b/tests/ui/explicit-tail-calls/c-variadic.rs @@ -3,7 +3,7 @@ #![allow(unused)] unsafe extern "C" fn foo(mut ap: ...) -> u32 { - ap.arg::() + ap.next_arg::() } extern "C" fn bar() -> u32 { diff --git a/tests/ui/sanitizer/kcfi-c-variadic.rs b/tests/ui/sanitizer/kcfi-c-variadic.rs index 45d00a4524ebf..651029ab7dfe6 100644 --- a/tests/ui/sanitizer/kcfi-c-variadic.rs +++ b/tests/ui/sanitizer/kcfi-c-variadic.rs @@ -8,7 +8,7 @@ trait Trait { unsafe extern "C" fn foo(x: i32, y: i32, mut ap: ...) -> i32 { - x + y + ap.arg::() + ap.arg::() + x + y + ap.next_arg::() + ap.next_arg::() } }