diff options
| author | bors <bors@rust-lang.org> | 2025-04-11 10:53:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-11 10:53:45 +0000 |
| commit | 71b68da1bd9fa6afb9f964a731e9c843ab0862bd (patch) | |
| tree | 093b90526966ddf66f3c994057a2b8f426463f9f | |
| parent | 81d8c747fbdb17775dc4e107ad7e430e61a4e751 (diff) | |
| parent | 3ebf1c2e67a03d514c0240b1d17aab3c1d2a8a04 (diff) | |
| download | rust-71b68da1bd9fa6afb9f964a731e9c843ab0862bd.tar.gz rust-71b68da1bd9fa6afb9f964a731e9c843ab0862bd.zip | |
Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxu
Fix breakage when running compiletest with `--test-args=--edition=2015` Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter. This PR fixes the two categories of failures happening when `--edition=2015` is passed: * Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error. * Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation. Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests. I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed. r? `@jieyouxu`
111 files changed, 208 insertions, 151 deletions
diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md index 7ed583c1007..4ec2909b8fa 100644 --- a/src/doc/rustc-dev-guide/src/tests/directives.md +++ b/src/doc/rustc-dev-guide/src/tests/directives.md @@ -234,14 +234,14 @@ ignoring debuggers. ### Affecting how tests are built -| Directive | Explanation | Supported test suites | Possible values | -|---------------------|----------------------------------------------------------------------------------------------|---------------------------|------------------------------------------------------------------------------| -| `compile-flags` | Flags passed to `rustc` when building the test or aux file | All except for `run-make` | Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental`. | -| `edition` | Alias for `compile-flags: --edition=xxx` | All except for `run-make` | Any valid `--edition` value | -| `rustc-env` | Env var to set when running `rustc` | All except for `run-make` | `<KEY>=<VALUE>` | -| `unset-rustc-env` | Env var to unset when running `rustc` | All except for `run-make` | Any env var name | -| `incremental` | Proper incremental support for tests outside of incremental test suite | `ui`, `crashes` | N/A | -| `no-prefer-dynamic` | Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag | `ui`, `crashes` | N/A | +| Directive | Explanation | Supported test suites | Possible values | +|---------------------|----------------------------------------------------------------------------------------------|---------------------------|--------------------------------------------------------------------------------------------| +| `compile-flags` | Flags passed to `rustc` when building the test or aux file | All except for `run-make` | Any valid `rustc` flags, e.g. `-Awarnings -Dfoo`. Cannot be `-Cincremental` or `--edition` | +| `edition` | The edition used to build the test | All except for `run-make` | Any valid `--edition` value | +| `rustc-env` | Env var to set when running `rustc` | All except for `run-make` | `<KEY>=<VALUE>` | +| `unset-rustc-env` | Env var to unset when running `rustc` | All except for `run-make` | Any env var name | +| `incremental` | Proper incremental support for tests outside of incremental test suite | `ui`, `crashes` | N/A | +| `no-prefer-dynamic` | Don't use `-C prefer-dynamic`, don't build as a dylib via a `--crate-type=dylib` preset flag | `ui`, `crashes` | N/A | <div class="warning"> Tests (outside of `run-make`) that want to use incremental tests not in the diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 01a6ae00825..3406e8749a1 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -389,14 +389,22 @@ impl TestProps { } if let Some(flags) = config.parse_name_value_directive(ln, COMPILE_FLAGS) { - self.compile_flags.extend(split_flags(&flags)); + let flags = split_flags(&flags); + for flag in &flags { + if flag == "--edition" || flag.starts_with("--edition=") { + panic!("you must use `//@ edition` to configure the edition"); + } + } + self.compile_flags.extend(flags); } if config.parse_name_value_directive(ln, INCORRECT_COMPILER_FLAGS).is_some() { panic!("`compiler-flags` directive should be spelled `compile-flags`"); } if let Some(edition) = config.parse_edition(ln) { - self.compile_flags.push(format!("--edition={}", edition.trim())); + // The edition is added at the start, since flags from //@compile-flags must + // be passed to rustc last. + self.compile_flags.insert(0, format!("--edition={}", edition.trim())); has_edition = true; } @@ -624,7 +632,9 @@ impl TestProps { } if let (Some(edition), false) = (&config.edition, has_edition) { - self.compile_flags.push(format!("--edition={}", edition)); + // The edition is added at the start, since flags from //@compile-flags must be passed + // to rustc last. + self.compile_flags.insert(0, format!("--edition={}", edition)); } } diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 9c03fa141bd..208d32833c9 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -177,6 +177,7 @@ pub fn compute_stamp_hash(config: &Config) -> String { let mut hash = DefaultHasher::new(); config.stage_id.hash(&mut hash); config.run.hash(&mut hash); + config.edition.hash(&mut hash); match config.debugger { Some(Debugger::Cdb) => { diff --git a/tests/assembly/cstring-merging.rs b/tests/assembly/cstring-merging.rs index 7436e241823..07f25d1e1a4 100644 --- a/tests/assembly/cstring-merging.rs +++ b/tests/assembly/cstring-merging.rs @@ -1,6 +1,7 @@ //@ only-linux //@ assembly-output: emit-asm -//@ compile-flags: --crate-type=lib -Copt-level=3 --edition 2024 +//@ compile-flags: --crate-type=lib -Copt-level=3 +//@ edition: 2024 use std::ffi::CStr; diff --git a/tests/codegen/async-closure-debug.rs b/tests/codegen/async-closure-debug.rs index 2d67e02eb9c..b5b369e6e54 100644 --- a/tests/codegen/async-closure-debug.rs +++ b/tests/codegen/async-closure-debug.rs @@ -1,6 +1,7 @@ // Just make sure that async closures don't ICE. // -//@ compile-flags: -C debuginfo=2 --edition=2018 +//@ compile-flags: -C debuginfo=2 +//@ edition: 2018 //@ ignore-msvc // CHECK-DAG: [[GEN_FN:!.*]] = !DINamespace(name: "async_closure_test" diff --git a/tests/codegen/async-fn-debug-awaitee-field.rs b/tests/codegen/async-fn-debug-awaitee-field.rs index ab13d4509e2..50860c90662 100644 --- a/tests/codegen/async-fn-debug-awaitee-field.rs +++ b/tests/codegen/async-fn-debug-awaitee-field.rs @@ -7,7 +7,8 @@ //@[MSVC] only-msvc //@[NONMSVC] ignore-msvc -//@ compile-flags: -C debuginfo=2 --edition=2018 -Copt-level=0 +//@ compile-flags: -C debuginfo=2 -Copt-level=0 +//@ edition: 2018 #![crate_type = "lib"] diff --git a/tests/codegen/async-fn-debug-msvc.rs b/tests/codegen/async-fn-debug-msvc.rs index 7c695042b42..e0c601146f8 100644 --- a/tests/codegen/async-fn-debug-msvc.rs +++ b/tests/codegen/async-fn-debug-msvc.rs @@ -4,7 +4,8 @@ // - Other fields are not marked artificial // // -//@ compile-flags: -C debuginfo=2 --edition=2018 +//@ compile-flags: -C debuginfo=2 +//@ edition: 2018 //@ only-msvc async fn foo() {} @@ -19,23 +20,23 @@ async fn async_fn_test() { // CHECK-DAG: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<async_fn_debug_msvc::async_fn_test::async_fn_env$0>", // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant0", scope: [[GEN]], // For brevity, we only check the struct name and members of the last variant. -// CHECK-SAME: file: [[FILE:![0-9]*]], line: 11, +// CHECK-SAME: file: [[FILE:![0-9]*]], line: 12, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant1", scope: [[GEN]], -// CHECK-SAME: file: [[FILE]], line: 15, +// CHECK-SAME: file: [[FILE]], line: 16, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant2", scope: [[GEN]], -// CHECK-SAME: file: [[FILE]], line: 15, +// CHECK-SAME: file: [[FILE]], line: 16, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant3", scope: [[GEN]], -// CHECK-SAME: file: [[FILE]], line: 12, +// CHECK-SAME: file: [[FILE]], line: 13, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant4", scope: [[GEN]], -// CHECK-SAME: file: [[FILE]], line: 14, +// CHECK-SAME: file: [[FILE]], line: 15, // CHECK-SAME: baseType: [[VARIANT_WRAPPER:![0-9]*]] // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) diff --git a/tests/codegen/async-fn-debug.rs b/tests/codegen/async-fn-debug.rs index 7be4ad45665..ed704c7cc8b 100644 --- a/tests/codegen/async-fn-debug.rs +++ b/tests/codegen/async-fn-debug.rs @@ -4,7 +4,8 @@ // - Other fields are not marked artificial // // -//@ compile-flags: -C debuginfo=2 --edition=2018 +//@ compile-flags: -C debuginfo=2 +//@ edition: 2018 //@ ignore-msvc async fn foo() {} @@ -22,26 +23,26 @@ async fn async_fn_test() { // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: discriminator: [[DISC:![0-9]*]] // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "0", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE:![0-9]*]], line: 11, +// CHECK-SAME: file: [[FILE:![0-9]*]], line: 12, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "Unresumed", scope: [[GEN]], // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "1", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 15, +// CHECK-SAME: file: [[FILE]], line: 16, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "2", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 15, +// CHECK-SAME: file: [[FILE]], line: 16, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "3", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 12, +// CHECK-SAME: file: [[FILE]], line: 13, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "4", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 14, +// CHECK-SAME: file: [[FILE]], line: 15, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: [[S1:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Suspend1", scope: [[GEN]], diff --git a/tests/codegen/coroutine-debug.rs b/tests/codegen/coroutine-debug.rs index d00667a37d5..ff62e9709b4 100644 --- a/tests/codegen/coroutine-debug.rs +++ b/tests/codegen/coroutine-debug.rs @@ -4,7 +4,8 @@ // - Other fields are not marked artificial // // -//@ compile-flags: -C debuginfo=2 --edition=2018 +//@ compile-flags: -C debuginfo=2 +//@ edition: 2018 //@ ignore-msvc #![feature(coroutines, coroutine_trait)] @@ -27,26 +28,26 @@ fn coroutine_test() -> impl Coroutine<Yield = i32, Return = ()> { // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: discriminator: [[DISC:![0-9]*]] // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "0", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE:![0-9]*]], line: 15, +// CHECK-SAME: file: [[FILE:![0-9]*]], line: 16, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DICompositeType(tag: DW_TAG_structure_type, name: "Unresumed", scope: [[GEN]], // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "1", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 19, +// CHECK-SAME: file: [[FILE]], line: 20, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "2", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 19, +// CHECK-SAME: file: [[FILE]], line: 20, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "3", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 16, +// CHECK-SAME: file: [[FILE]], line: 17, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "4", scope: [[VARIANT]], -// CHECK-SAME: file: [[FILE]], line: 18, +// CHECK-SAME: file: [[FILE]], line: 19, // CHECK-NOT: flags: DIFlagArtificial // CHECK-SAME: ) // CHECK: [[S1:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Suspend1", scope: [[GEN]], diff --git a/tests/codegen/debuginfo-generic-closure-env-names.rs b/tests/codegen/debuginfo-generic-closure-env-names.rs index 6b314c9abae..64bc58e1df7 100644 --- a/tests/codegen/debuginfo-generic-closure-env-names.rs +++ b/tests/codegen/debuginfo-generic-closure-env-names.rs @@ -18,7 +18,8 @@ // legacy mangling scheme rustc version and generic parameters are both hashed into a single part // of the name, thus randomizing item order with respect to rustc version. -//@ compile-flags: -Cdebuginfo=2 --edition 2021 -Copt-level=0 -Csymbol-mangling-version=v0 +//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Csymbol-mangling-version=v0 +//@ edition: 2021 // non_generic_closure() // NONMSVC: !DICompositeType(tag: DW_TAG_structure_type, name: "{closure_env#0}", scope: ![[non_generic_closure_NAMESPACE:[0-9]+]], diff --git a/tests/codegen/infallible-unwrap-in-opt-z.rs b/tests/codegen/infallible-unwrap-in-opt-z.rs index 3756fafe384..c2297c58e77 100644 --- a/tests/codegen/infallible-unwrap-in-opt-z.rs +++ b/tests/codegen/infallible-unwrap-in-opt-z.rs @@ -1,4 +1,5 @@ -//@ compile-flags: -C opt-level=z --edition=2021 +//@ compile-flags: -C opt-level=z +//@ edition: 2021 #![crate_type = "lib"] diff --git a/tests/codegen/inline-function-args-debug-info.rs b/tests/codegen/inline-function-args-debug-info.rs index 53a179160dc..c31419cb914 100644 --- a/tests/codegen/inline-function-args-debug-info.rs +++ b/tests/codegen/inline-function-args-debug-info.rs @@ -2,7 +2,8 @@ // gets inlined by MIR inlining. Without function argument indexes, `info args` in gdb won't show // arguments and their values for the current function. -//@ compile-flags: -Zinline-mir=yes -Cdebuginfo=2 --edition=2021 +//@ compile-flags: -Zinline-mir=yes -Cdebuginfo=2 +//@ edition: 2021 #![crate_type = "lib"] @@ -14,9 +15,9 @@ pub fn outer_function(x: usize, y: usize) -> usize { #[inline] fn inner_function(aaaa: usize, bbbb: usize) -> usize { // CHECK: !DILocalVariable(name: "aaaa", arg: 1 - // CHECK-SAME: line: 15 + // CHECK-SAME: line: 16 // CHECK-NOT: !DILexicalBlock( // CHECK: !DILocalVariable(name: "bbbb", arg: 2 - // CHECK-SAME: line: 15 + // CHECK-SAME: line: 16 aaaa + bbbb } diff --git a/tests/codegen/issues/issue-119422.rs b/tests/codegen/issues/issue-119422.rs index e1a082c377f..17ae71605b5 100644 --- a/tests/codegen/issues/issue-119422.rs +++ b/tests/codegen/issues/issue-119422.rs @@ -1,7 +1,8 @@ //! This test checks that compiler don't generate useless compares to zeros //! for `NonZero` integer types. //! -//@ compile-flags: -Copt-level=3 --edition=2021 -Zmerge-functions=disabled +//@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled +//@ edition: 2021 //@ only-64bit (because the LLVM type of i64 for usize shows up) #![crate_type = "lib"] diff --git a/tests/codegen/simd/simd-wide-sum.rs b/tests/codegen/simd/simd-wide-sum.rs index fb9b61884e7..95117b2c748 100644 --- a/tests/codegen/simd/simd-wide-sum.rs +++ b/tests/codegen/simd/simd-wide-sum.rs @@ -1,5 +1,6 @@ //@ revisions: llvm mir-opt3 -//@ compile-flags: -C opt-level=3 -Z merge-functions=disabled --edition=2021 +//@ compile-flags: -C opt-level=3 -Z merge-functions=disabled +//@ edition: 2021 //@ only-x86_64 //@ [mir-opt3]compile-flags: -Zmir-opt-level=3 //@ [mir-opt3]build-pass diff --git a/tests/codegen/try_question_mark_nop.rs b/tests/codegen/try_question_mark_nop.rs index 9f68d742a75..398c9a580bc 100644 --- a/tests/codegen/try_question_mark_nop.rs +++ b/tests/codegen/try_question_mark_nop.rs @@ -1,4 +1,5 @@ -//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled --edition=2021 +//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled +//@ edition: 2021 //@ only-x86_64 //@ revisions: NINETEEN TWENTY //@[NINETEEN] exact-llvm-major-version: 19 diff --git a/tests/crashes/119095.rs b/tests/crashes/119095.rs index 28742e0d5da..9b6c976d3e5 100644 --- a/tests/crashes/119095.rs +++ b/tests/crashes/119095.rs @@ -1,5 +1,5 @@ //@ known-bug: #119095 -//@ compile-flags: --edition=2021 +//@ edition: 2021 fn any<T>() -> T { loop {} diff --git a/tests/crashes/120016.rs b/tests/crashes/120016.rs index faba1af91b4..7eda330e7ad 100644 --- a/tests/crashes/120016.rs +++ b/tests/crashes/120016.rs @@ -1,5 +1,6 @@ //@ known-bug: #120016 -//@ compile-flags: -Zcrate-attr=feature(const_async_blocks) --edition=2021 +//@ compile-flags: -Zcrate-attr=feature(const_async_blocks) +//@ edition: 2021 #![feature(type_alias_impl_trait, const_async_blocks)] diff --git a/tests/crashes/127033.rs b/tests/crashes/127033.rs index 919c9dfd30e..52b880e4859 100644 --- a/tests/crashes/127033.rs +++ b/tests/crashes/127033.rs @@ -1,5 +1,5 @@ //@ known-bug: #127033 -//@ compile-flags: --edition=2021 +//@ edition: 2021 pub trait RaftLogStorage { fn save_vote(vote: ()) -> impl std::future::Future + Send; diff --git a/tests/crashes/128094.rs b/tests/crashes/128094.rs index 5f0ae108f8f..56d09d78bed 100644 --- a/tests/crashes/128094.rs +++ b/tests/crashes/128094.rs @@ -1,5 +1,6 @@ //@ known-bug: rust-lang/rust#128094 -//@ compile-flags: -Zmir-enable-passes=+GVN --edition=2018 +//@ compile-flags: -Zmir-enable-passes=+GVN +//@ edition: 2018 pub enum Request { TestSome(T), diff --git a/tests/crashes/132103.rs b/tests/crashes/132103.rs index 5bf4792c44c..e2d8378efe6 100644 --- a/tests/crashes/132103.rs +++ b/tests/crashes/132103.rs @@ -1,5 +1,6 @@ //@ known-bug: #132103 -//@compile-flags: -Zvalidate-mir --edition=2018 -Zinline-mir=yes +//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes +//@ edition: 2018 use core::future::{async_drop_in_place, Future}; use core::mem::{self}; use core::pin::pin; diff --git a/tests/crashes/132430.rs b/tests/crashes/132430.rs index 995bdf06224..81c8c6d6f7d 100644 --- a/tests/crashes/132430.rs +++ b/tests/crashes/132430.rs @@ -1,6 +1,7 @@ //@ known-bug: #132430 -//@compile-flags: --edition=2018 --crate-type=lib +//@ compile-flags: --crate-type=lib +//@ edition: 2018 #![feature(cmse_nonsecure_entry)] struct Test; diff --git a/tests/crashes/135128.rs b/tests/crashes/135128.rs index a8fd1ae1ff5..c718b758dc6 100644 --- a/tests/crashes/135128.rs +++ b/tests/crashes/135128.rs @@ -1,5 +1,6 @@ //@ known-bug: #135128 -//@ compile-flags: -Copt-level=1 --edition=2021 +//@ compile-flags: -Copt-level=1 +//@ edition: 2021 #![feature(trivial_bounds)] diff --git a/tests/crashes/135470.rs b/tests/crashes/135470.rs index 7d357a9317f..efa017b5457 100644 --- a/tests/crashes/135470.rs +++ b/tests/crashes/135470.rs @@ -1,5 +1,6 @@ //@ known-bug: #135470 -//@ compile-flags: --edition=2021 -Copt-level=0 +//@ compile-flags: -Copt-level=0 +//@ edition: 2021 use std::future::Future; trait Access { diff --git a/tests/crashes/135646.rs b/tests/crashes/135646.rs index 67b0ad93db4..841ea5b81b4 100644 --- a/tests/crashes/135646.rs +++ b/tests/crashes/135646.rs @@ -1,5 +1,7 @@ //@ known-bug: #135646 -//@ compile-flags: --edition=2024 -Zpolonius=next +//@ compile-flags: -Zpolonius=next +//@ edition: 2024 + fn main() { &{ [1, 2, 3][4] }; } diff --git a/tests/crashes/135668.rs b/tests/crashes/135668.rs index 8126a65606b..00d7b5db0c6 100644 --- a/tests/crashes/135668.rs +++ b/tests/crashes/135668.rs @@ -1,5 +1,5 @@ //@ known-bug: #135668 -//@ compile-flags: --edition=2021 +//@ edition: 2021 use std::future::Future; pub async fn foo() { diff --git a/tests/crashes/137467-1.rs b/tests/crashes/137467-1.rs index 1d62cba59a7..b6bff2bdc4e 100644 --- a/tests/crashes/137467-1.rs +++ b/tests/crashes/137467-1.rs @@ -1,5 +1,5 @@ //@ known-bug: #137467 -//@ compile-flags: --edition=2021 +//@ edition: 2021 enum Camera { Normal { base_transform: i32 }, Volume { transform: i32 }, diff --git a/tests/crashes/137467-2.rs b/tests/crashes/137467-2.rs index 151d6a0767f..a70ea92b22d 100644 --- a/tests/crashes/137467-2.rs +++ b/tests/crashes/137467-2.rs @@ -1,5 +1,5 @@ //@ known-bug: #137467 -//@ compile-flags: --edition=2021 +//@ edition: 2021 enum Camera { Normal { base_transform: i32 }, diff --git a/tests/crashes/137467-3.rs b/tests/crashes/137467-3.rs index 2140fe044a7..cb81a9a912e 100644 --- a/tests/crashes/137467-3.rs +++ b/tests/crashes/137467-3.rs @@ -1,5 +1,5 @@ //@ known-bug: #137467 -//@ compile-flags: --edition=2021 +//@ edition: 2021 fn meow(x: (u32, u32, u32)) { let f = || { diff --git a/tests/crashes/137916.rs b/tests/crashes/137916.rs index 3d6b0e0fbab..b25e7b200d9 100644 --- a/tests/crashes/137916.rs +++ b/tests/crashes/137916.rs @@ -1,5 +1,5 @@ //@ known-bug: #137916 -//@ compile-flags: --edition=2021 +//@ edition: 2021 use std::ptr::null; async fn a() -> Box<dyn Send> { diff --git a/tests/debuginfo/coroutine-closure.rs b/tests/debuginfo/coroutine-closure.rs index ffb6ae68a2b..002531084fb 100644 --- a/tests/debuginfo/coroutine-closure.rs +++ b/tests/debuginfo/coroutine-closure.rs @@ -1,6 +1,7 @@ #![feature(async_closure)] //@ only-cdb -//@ compile-flags:-g --edition=2021 +//@ compile-flags: -g +//@ edition: 2021 // === CDB TESTS ================================================================================== diff --git a/tests/incremental/issue-85360-eval-obligation-ice.rs b/tests/incremental/issue-85360-eval-obligation-ice.rs index 6efae1aa12d..70bb43f39ec 100644 --- a/tests/incremental/issue-85360-eval-obligation-ice.rs +++ b/tests/incremental/issue-85360-eval-obligation-ice.rs @@ -1,6 +1,7 @@ //@ revisions:cfail1 cfail2 -//@[cfail1] compile-flags: --crate-type=lib --edition=2021 -Zassert-incr-state=not-loaded -//@[cfail2] compile-flags: --crate-type=lib --edition=2021 -Zassert-incr-state=loaded +//@[cfail1] compile-flags: --crate-type=lib -Zassert-incr-state=not-loaded +//@[cfail2] compile-flags: --crate-type=lib -Zassert-incr-state=loaded +//@ edition: 2021 //@ build-pass use core::any::Any; diff --git a/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.rs b/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.rs index d8c43100d2f..1ed67694a90 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.rs +++ b/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.rs @@ -1,7 +1,8 @@ // FIXME: if/when the output of the test harness can be tested on its own, this test should be // adapted to use that, and that normalize line can go away -//@ compile-flags:--test --edition 2021 +//@ compile-flags: --test +//@ edition: 2021 //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ failure-status: 101 diff --git a/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.stdout b/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.stdout index 63d987de8a9..9f4d60e6f4d 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-should-panic-2021.stdout @@ -1,14 +1,14 @@ running 1 test -test $DIR/failed-doctest-should-panic-2021.rs - Foo (line 9) ... FAILED +test $DIR/failed-doctest-should-panic-2021.rs - Foo (line 10) ... FAILED failures: ----- $DIR/failed-doctest-should-panic-2021.rs - Foo (line 9) stdout ---- +---- $DIR/failed-doctest-should-panic-2021.rs - Foo (line 10) stdout ---- Test executable succeeded, but it's marked `should_panic`. failures: - $DIR/failed-doctest-should-panic-2021.rs - Foo (line 9) + $DIR/failed-doctest-should-panic-2021.rs - Foo (line 10) test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs b/tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs index 636c3c8de42..bcfb790e55f 100644 --- a/tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs +++ b/tests/rustdoc-ui/intra-doc/import-inline-merge-module.rs @@ -3,7 +3,8 @@ //@ check-pass //@ aux-build: inner-crate-doc.rs -//@ compile-flags: --extern inner_crate_doc --edition 2018 +//@ compile-flags: --extern inner_crate_doc +//@ edition: 2018 /// Import doc comment [inner_crate_doc] #[doc(inline)] diff --git a/tests/rustdoc/auxiliary/primitive-doc.rs b/tests/rustdoc/auxiliary/primitive-doc.rs index a7253ed2450..859716c38e4 100644 --- a/tests/rustdoc/auxiliary/primitive-doc.rs +++ b/tests/rustdoc/auxiliary/primitive-doc.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --crate-type lib --edition 2018 +//@ compile-flags: --crate-type lib +//@ edition: 2018 #![feature(rustc_attrs)] #![feature(no_core)] diff --git a/tests/rustdoc/auxiliary/primitive-reexport.rs b/tests/rustdoc/auxiliary/primitive-reexport.rs index 18b57037634..7c85038674b 100644 --- a/tests/rustdoc/auxiliary/primitive-reexport.rs +++ b/tests/rustdoc/auxiliary/primitive-reexport.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --emit metadata --crate-type lib --edition 2018 +//@ compile-flags: --emit metadata --crate-type lib +//@ edition: 2018 #![crate_name = "foo"] diff --git a/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs b/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs index 7cec30c8b74..30834bd7210 100644 --- a/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs +++ b/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs @@ -6,7 +6,8 @@ //@ aux-build:empty2.rs //@ aux-crate:priv:empty2=empty2.rs //@ build-aux-docs -//@ compile-flags:-Z unstable-options --edition 2018 +//@ compile-flags:-Z unstable-options +//@ edition: 2018 //@ has extern_crate_only_used_in_link/index.html //@ has - '//a[@href="../issue_66159_1/struct.Something.html"]' 'issue_66159_1::Something' diff --git a/tests/rustdoc/primitive-reexport.rs b/tests/rustdoc/primitive-reexport.rs index eb255745392..9b23b24fc93 100644 --- a/tests/rustdoc/primitive-reexport.rs +++ b/tests/rustdoc/primitive-reexport.rs @@ -1,5 +1,6 @@ //@ aux-build: primitive-reexport.rs -//@ compile-flags:--extern foo --edition 2018 +//@ compile-flags: --extern foo +//@ edition: 2018 #![crate_name = "bar"] diff --git a/tests/rustdoc/primitive-slice-auto-trait.rs b/tests/rustdoc/primitive-slice-auto-trait.rs index e78d1d94614..647c1cca948 100644 --- a/tests/rustdoc/primitive-slice-auto-trait.rs +++ b/tests/rustdoc/primitive-slice-auto-trait.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --crate-type lib --edition 2018 +//@ compile-flags: --crate-type lib +//@ edition: 2018 #![crate_name = "foo"] #![feature(rustc_attrs)] diff --git a/tests/rustdoc/primitive-tuple-auto-trait.rs b/tests/rustdoc/primitive-tuple-auto-trait.rs index 045478e6b4f..51300bd6b2f 100644 --- a/tests/rustdoc/primitive-tuple-auto-trait.rs +++ b/tests/rustdoc/primitive-tuple-auto-trait.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --crate-type lib --edition 2018 +//@ compile-flags: --crate-type lib +//@ edition: 2018 #![crate_name = "foo"] #![feature(rustc_attrs)] diff --git a/tests/rustdoc/primitive-tuple-variadic.rs b/tests/rustdoc/primitive-tuple-variadic.rs index d142729d2a8..bab5eaae9a2 100644 --- a/tests/rustdoc/primitive-tuple-variadic.rs +++ b/tests/rustdoc/primitive-tuple-variadic.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --crate-type lib --edition 2018 +//@ compile-flags: --crate-type lib +//@ edition: 2018 #![crate_name = "foo"] #![feature(rustdoc_internals)] diff --git a/tests/rustdoc/primitive-unit-auto-trait.rs b/tests/rustdoc/primitive-unit-auto-trait.rs index 6cae094c21c..7dada1f9832 100644 --- a/tests/rustdoc/primitive-unit-auto-trait.rs +++ b/tests/rustdoc/primitive-unit-auto-trait.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --crate-type lib --edition 2018 +//@ compile-flags: --crate-type lib +//@ edition: 2018 #![crate_name = "foo"] #![feature(rustc_attrs)] diff --git a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs index 069744a3282..12dca587e07 100644 --- a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs +++ b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.rs @@ -1,4 +1,5 @@ -//@ compile-flags: -Zvalidate-mir --edition=2018 --crate-type=lib -Copt-level=3 +//@ compile-flags: -Zvalidate-mir --crate-type=lib -Copt-level=3 +//@ edition: 2018 fn main() {} diff --git a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr index 52697bac509..03fa220b0bf 100644 --- a/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr +++ b/tests/ui/async-await/async-closures/closure-shim-borrowck-error.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `x` which is behind a mutable reference - --> $DIR/closure-shim-borrowck-error.rs:10:18 + --> $DIR/closure-shim-borrowck-error.rs:11:18 | LL | needs_fn_mut(async || { | ^^^^^^^^ `x` is moved here @@ -11,7 +11,7 @@ LL | x.hello(); | move occurs because `x` has type `Ty`, which does not implement the `Copy` trait | note: if `Ty` implemented `Clone`, you could clone the value - --> $DIR/closure-shim-borrowck-error.rs:16:1 + --> $DIR/closure-shim-borrowck-error.rs:17:1 | LL | x.hello(); | - you could clone this value diff --git a/tests/ui/async-await/issue-60709.rs b/tests/ui/async-await/issue-60709.rs index 8634d6f7768..a3f54d70316 100644 --- a/tests/ui/async-await/issue-60709.rs +++ b/tests/ui/async-await/issue-60709.rs @@ -1,6 +1,7 @@ // This used to compile the future down to ud2, due to uninhabited types being // handled incorrectly in coroutines. -//@ compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018 +//@ compile-flags: -Copt-level=z -Cdebuginfo=2 +//@ edition: 2018 //@ run-pass diff --git a/tests/ui/async-await/issues/issue-59972.rs b/tests/ui/async-await/issues/issue-59972.rs index c30477fcd30..e64a856fab3 100644 --- a/tests/ui/async-await/issues/issue-59972.rs +++ b/tests/ui/async-await/issues/issue-59972.rs @@ -4,7 +4,8 @@ //@ run-pass -//@ compile-flags: --edition=2018 -Aunused +//@ compile-flags: -Aunused +//@ edition: 2018 pub enum Uninhabited { } diff --git a/tests/ui/check-cfg/raw-keywords.edition2015.stderr b/tests/ui/check-cfg/raw-keywords.edition2015.stderr index 8ca33e088fc..29c1a71c0b7 100644 --- a/tests/ui/check-cfg/raw-keywords.edition2015.stderr +++ b/tests/ui/check-cfg/raw-keywords.edition2015.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition name: `tru` - --> $DIR/raw-keywords.rs:14:7 + --> $DIR/raw-keywords.rs:15:7 | LL | #[cfg(tru)] | ^^^ help: there is a config with a similar name: `r#true` @@ -9,7 +9,7 @@ LL | #[cfg(tru)] = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition name: `r#false` - --> $DIR/raw-keywords.rs:19:7 + --> $DIR/raw-keywords.rs:20:7 | LL | #[cfg(r#false)] | ^^^^^^^ @@ -19,7 +19,7 @@ LL | #[cfg(r#false)] = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition name: `await` - --> $DIR/raw-keywords.rs:27:29 + --> $DIR/raw-keywords.rs:28:29 | LL | #[cfg_attr(edition2015, cfg(await))] | ^^^^^ @@ -28,7 +28,7 @@ LL | #[cfg_attr(edition2015, cfg(await))] = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition name: `raw` - --> $DIR/raw-keywords.rs:33:7 + --> $DIR/raw-keywords.rs:34:7 | LL | #[cfg(r#raw)] | ^^^^^ diff --git a/tests/ui/check-cfg/raw-keywords.edition2021.stderr b/tests/ui/check-cfg/raw-keywords.edition2021.stderr index cce55720bdd..cc3702685fd 100644 --- a/tests/ui/check-cfg/raw-keywords.edition2021.stderr +++ b/tests/ui/check-cfg/raw-keywords.edition2021.stderr @@ -1,5 +1,5 @@ warning: unexpected `cfg` condition name: `tru` - --> $DIR/raw-keywords.rs:14:7 + --> $DIR/raw-keywords.rs:15:7 | LL | #[cfg(tru)] | ^^^ help: there is a config with a similar name: `r#true` @@ -9,7 +9,7 @@ LL | #[cfg(tru)] = note: `#[warn(unexpected_cfgs)]` on by default warning: unexpected `cfg` condition name: `r#false` - --> $DIR/raw-keywords.rs:19:7 + --> $DIR/raw-keywords.rs:20:7 | LL | #[cfg(r#false)] | ^^^^^^^ @@ -19,7 +19,7 @@ LL | #[cfg(r#false)] = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition name: `r#await` - --> $DIR/raw-keywords.rs:28:29 + --> $DIR/raw-keywords.rs:29:29 | LL | #[cfg_attr(edition2021, cfg(r#await))] | ^^^^^^^ @@ -28,7 +28,7 @@ LL | #[cfg_attr(edition2021, cfg(r#await))] = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration warning: unexpected `cfg` condition name: `raw` - --> $DIR/raw-keywords.rs:33:7 + --> $DIR/raw-keywords.rs:34:7 | LL | #[cfg(r#raw)] | ^^^^^ diff --git a/tests/ui/check-cfg/raw-keywords.rs b/tests/ui/check-cfg/raw-keywords.rs index 5de13240d7e..b82eb5a64e9 100644 --- a/tests/ui/check-cfg/raw-keywords.rs +++ b/tests/ui/check-cfg/raw-keywords.rs @@ -6,7 +6,8 @@ //@ compile-flags: --cfg=true --cfg=async --check-cfg=cfg(r#true,r#async,edition2015,edition2021) // //@ revisions: edition2015 edition2021 -//@ [edition2021] compile-flags: --edition 2021 +//@ [edition2015] edition: 2015 +//@ [edition2021] edition: 2021 #[cfg(r#true)] fn foo() {} diff --git a/tests/ui/closures/2229_closure_analysis/issue-89606.rs b/tests/ui/closures/2229_closure_analysis/issue-89606.rs index 8c88a4b8226..5494686356d 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-89606.rs +++ b/tests/ui/closures/2229_closure_analysis/issue-89606.rs @@ -2,8 +2,8 @@ // //@ check-pass //@ revisions: twenty_eighteen twenty_twentyone -//@ [twenty_eighteen]compile-flags: --edition 2018 -//@ [twenty_twentyone]compile-flags: --edition 2021 +//@ [twenty_eighteen] edition: 2018 +//@ [twenty_twentyone] edition: 2021 struct S<'a>(Option<&'a mut i32>); diff --git a/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order2.rs b/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order2.rs index 4fc2e6c903a..a771b815702 100644 --- a/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order2.rs +++ b/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order2.rs @@ -1,8 +1,8 @@ //@ run-pass //@ check-run-results //@ revisions: twenty_eighteen twenty_twentyone -//@ [twenty_eighteen]compile-flags: --edition 2018 -//@ [twenty_twentyone]compile-flags: --edition 2021 +//@ [twenty_eighteen] edition: 2018 +//@ [twenty_twentyone] edition: 2021 #[derive(Debug)] struct Dropable(&'static str); diff --git a/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs b/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs index 2ac57f35674..7753b7d64fb 100644 --- a/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs +++ b/tests/ui/conditional-compilation/cfg_accessible-not_sure.rs @@ -1,6 +1,6 @@ //@ revisions: edition2015 edition2021 -//@ [edition2015]compile-flags: --edition=2015 -//@ [edition2021]compile-flags: --edition=2021 +//@ [edition2015] edition: 2015 +//@ [edition2021] edition: 2021 #![feature(extern_types)] #![feature(cfg_accessible)] diff --git a/tests/ui/consts/const-suggest-feature.rs b/tests/ui/consts/const-suggest-feature.rs index 0c940368976..dbb166dd6c5 100644 --- a/tests/ui/consts/const-suggest-feature.rs +++ b/tests/ui/consts/const-suggest-feature.rs @@ -1,4 +1,4 @@ -//@compile-flags: --edition 2018 +//@ edition: 2018 use std::cell::Cell; const WRITE: () = unsafe { diff --git a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs index d6f07994e82..8f2bcd82c73 100644 --- a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs +++ b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![unstable(feature = "humans", reason = "who ever let humans program computers, we're apparently really bad at it", diff --git a/tests/ui/coroutine/async-gen-deduce-yield.rs b/tests/ui/coroutine/async-gen-deduce-yield.rs index f85e4a52e9b..a9572ee9b0d 100644 --- a/tests/ui/coroutine/async-gen-deduce-yield.rs +++ b/tests/ui/coroutine/async-gen-deduce-yield.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 +//@ edition: 2024 //@ check-pass #![feature(async_iterator, gen_blocks)] diff --git a/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs b/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs index 583820c7aa3..53e3ce77f8a 100644 --- a/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs +++ b/tests/ui/coroutine/async-gen-yield-ty-is-unit.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2024 +//@ edition: 2024 //@ check-pass #![feature(async_iterator, gen_blocks)] diff --git a/tests/ui/debuginfo/issue-105386-debuginfo-ub.rs b/tests/ui/debuginfo/issue-105386-debuginfo-ub.rs index 7b850f32b4b..e926a337659 100644 --- a/tests/ui/debuginfo/issue-105386-debuginfo-ub.rs +++ b/tests/ui/debuginfo/issue-105386-debuginfo-ub.rs @@ -1,5 +1,6 @@ //@ run-pass -//@ compile-flags: --edition 2021 -Copt-level=3 -Cdebuginfo=2 -Zmir-opt-level=3 +//@ compile-flags: -Copt-level=3 -Cdebuginfo=2 -Zmir-opt-level=3 +//@ edition: 2021 fn main() { TranslatorI.visit_pre(); diff --git a/tests/ui/deprecation/try-macro-suggestion.rs b/tests/ui/deprecation/try-macro-suggestion.rs index 1e477ab9c88..0775f001100 100644 --- a/tests/ui/deprecation/try-macro-suggestion.rs +++ b/tests/ui/deprecation/try-macro-suggestion.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 fn foo() -> Result<(), ()> { Ok(try!()); //~ ERROR use of deprecated `try` macro Ok(try!(Ok(()))) //~ ERROR use of deprecated `try` macro diff --git a/tests/ui/feature-gates/feature-gate-try_blocks.rs b/tests/ui/feature-gates/feature-gate-try_blocks.rs index f565dd014de..90816293624 100644 --- a/tests/ui/feature-gates/feature-gate-try_blocks.rs +++ b/tests/ui/feature-gates/feature-gate-try_blocks.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 pub fn main() { let try_result: Option<_> = try { //~ ERROR `try` expression is experimental diff --git a/tests/ui/feature-gates/feature-gate-yeet_expr-in-cfg.rs b/tests/ui/feature-gates/feature-gate-yeet_expr-in-cfg.rs index 33fda822baa..a32ebed8dde 100644 --- a/tests/ui/feature-gates/feature-gate-yeet_expr-in-cfg.rs +++ b/tests/ui/feature-gates/feature-gate-yeet_expr-in-cfg.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2021 +//@ edition: 2021 pub fn demo() -> Option<i32> { #[cfg(FALSE)] diff --git a/tests/ui/feature-gates/feature-gate-yeet_expr.rs b/tests/ui/feature-gates/feature-gate-yeet_expr.rs index 12cc17e1cc8..6604f496917 100644 --- a/tests/ui/feature-gates/feature-gate-yeet_expr.rs +++ b/tests/ui/feature-gates/feature-gate-yeet_expr.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 pub fn demo() -> Option<i32> { do yeet //~ ERROR `do yeet` expression is experimental diff --git a/tests/ui/higher-ranked/trait-bounds/issue-95034.rs b/tests/ui/higher-ranked/trait-bounds/issue-95034.rs index 53b28c2bea4..f33469796c2 100644 --- a/tests/ui/higher-ranked/trait-bounds/issue-95034.rs +++ b/tests/ui/higher-ranked/trait-bounds/issue-95034.rs @@ -1,5 +1,6 @@ //@ check-pass -//@ compile-flags: --edition=2021 --crate-type=lib +//@ compile-flags: --crate-type=lib +//@ edition: 2021 use std::{ future::Future, diff --git a/tests/ui/impl-trait/auto-trait-contains-err.rs b/tests/ui/impl-trait/auto-trait-contains-err.rs index d7f094211d7..8a2ebe301f1 100644 --- a/tests/ui/impl-trait/auto-trait-contains-err.rs +++ b/tests/ui/impl-trait/auto-trait-contains-err.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ edition: 2021 use std::future::Future; diff --git a/tests/ui/imports/redundant-import-extern-prelude.rs b/tests/ui/imports/redundant-import-extern-prelude.rs index 0064eaa9318..b573b8fc610 100644 --- a/tests/ui/imports/redundant-import-extern-prelude.rs +++ b/tests/ui/imports/redundant-import-extern-prelude.rs @@ -5,7 +5,8 @@ // See also the discussion in <https://github.com/rust-lang/rust/pull/122954>. -//@ compile-flags: --extern aux_issue_121915 --edition 2018 +//@ compile-flags: --extern aux_issue_121915 +//@ edition: 2018 //@ aux-build: aux-issue-121915.rs #[deny(redundant_imports)] diff --git a/tests/ui/imports/redundant-import-extern-prelude.stderr b/tests/ui/imports/redundant-import-extern-prelude.stderr index 6d2518c1284..06cce7e1725 100644 --- a/tests/ui/imports/redundant-import-extern-prelude.stderr +++ b/tests/ui/imports/redundant-import-extern-prelude.stderr @@ -1,11 +1,11 @@ error: the item `aux_issue_121915` is imported redundantly - --> $DIR/redundant-import-extern-prelude.rs:14:9 + --> $DIR/redundant-import-extern-prelude.rs:15:9 | LL | use aux_issue_121915; | ^^^^^^^^^^^^^^^^ the item `aux_issue_121915` is already defined by the extern prelude | note: the lint level is defined here - --> $DIR/redundant-import-extern-prelude.rs:11:8 + --> $DIR/redundant-import-extern-prelude.rs:12:8 | LL | #[deny(redundant_imports)] | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/redundant-import-issue-121915-2015.rs b/tests/ui/imports/redundant-import-issue-121915-2015.rs index dc499bc40b6..7108776757e 100644 --- a/tests/ui/imports/redundant-import-issue-121915-2015.rs +++ b/tests/ui/imports/redundant-import-issue-121915-2015.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --extern aux_issue_121915 --edition 2015 +//@ compile-flags: --extern aux_issue_121915 +//@ edition: 2015 //@ aux-build: aux-issue-121915.rs extern crate aux_issue_121915; diff --git a/tests/ui/imports/redundant-import-issue-121915-2015.stderr b/tests/ui/imports/redundant-import-issue-121915-2015.stderr index f4e9f604896..367a4f1cd15 100644 --- a/tests/ui/imports/redundant-import-issue-121915-2015.stderr +++ b/tests/ui/imports/redundant-import-issue-121915-2015.stderr @@ -1,5 +1,5 @@ error: the item `aux_issue_121915` is imported redundantly - --> $DIR/redundant-import-issue-121915-2015.rs:8:9 + --> $DIR/redundant-import-issue-121915-2015.rs:9:9 | LL | extern crate aux_issue_121915; | ------------------------------ the item `aux_issue_121915` is already imported here @@ -8,7 +8,7 @@ LL | use aux_issue_121915; | ^^^^^^^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/redundant-import-issue-121915-2015.rs:6:8 + --> $DIR/redundant-import-issue-121915-2015.rs:7:8 | LL | #[deny(redundant_imports)] | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/imports/suggest-remove-issue-121315.rs b/tests/ui/imports/suggest-remove-issue-121315.rs index ee3ceb6e3a3..3c036b843fd 100644 --- a/tests/ui/imports/suggest-remove-issue-121315.rs +++ b/tests/ui/imports/suggest-remove-issue-121315.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2021 +//@ edition: 2021 #![deny(unused_imports, redundant_imports)] #![allow(dead_code)] diff --git a/tests/ui/label/label_break_value_desugared_break.rs b/tests/ui/label/label_break_value_desugared_break.rs index b7e7fd47c27..17ef1ba6d24 100644 --- a/tests/ui/label/label_break_value_desugared_break.rs +++ b/tests/ui/label/label_break_value_desugared_break.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] //@ run-pass diff --git a/tests/ui/let-else/issue-102317.rs b/tests/ui/let-else/issue-102317.rs index d94410e10a8..5afcacfc3aa 100644 --- a/tests/ui/let-else/issue-102317.rs +++ b/tests/ui/let-else/issue-102317.rs @@ -1,6 +1,7 @@ // issue #102317 //@ build-pass -//@ compile-flags: --edition 2021 -C opt-level=3 -Zvalidate-mir +//@ compile-flags: -C opt-level=3 -Zvalidate-mir +//@ edition: 2021 struct SegmentJob; diff --git a/tests/ui/lifetimes/issue-83737-binders-across-types.rs b/tests/ui/lifetimes/issue-83737-binders-across-types.rs index d20c84dae3f..6f399381294 100644 --- a/tests/ui/lifetimes/issue-83737-binders-across-types.rs +++ b/tests/ui/lifetimes/issue-83737-binders-across-types.rs @@ -1,5 +1,5 @@ //@ build-pass -//@ compile-flags: --edition 2018 +//@ edition: 2018 //@ compile-flags: --crate-type rlib use std::future::Future; diff --git a/tests/ui/lifetimes/issue-83737-erasing-bound-vars.rs b/tests/ui/lifetimes/issue-83737-erasing-bound-vars.rs index 466bcdc6be0..dcc8c7e94ba 100644 --- a/tests/ui/lifetimes/issue-83737-erasing-bound-vars.rs +++ b/tests/ui/lifetimes/issue-83737-erasing-bound-vars.rs @@ -1,5 +1,5 @@ //@ build-pass -//@ compile-flags: --edition 2018 +//@ edition: 2018 //@ compile-flags: --crate-type rlib use std::future::Future; diff --git a/tests/ui/lint/unqualified_local_imports.rs b/tests/ui/lint/unqualified_local_imports.rs index 9de71471342..b7036f9c68e 100644 --- a/tests/ui/lint/unqualified_local_imports.rs +++ b/tests/ui/lint/unqualified_local_imports.rs @@ -1,4 +1,4 @@ -//@compile-flags: --edition 2018 +//@ edition: 2018 #![feature(unqualified_local_imports)] #![deny(unqualified_local_imports)] diff --git a/tests/ui/lint/unused/issue-70041.rs b/tests/ui/lint/unused/issue-70041.rs index 817dfe82114..890ba378263 100644 --- a/tests/ui/lint/unused/issue-70041.rs +++ b/tests/ui/lint/unused/issue-70041.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2018 +//@ edition: 2018 //@ run-pass macro_rules! regex { diff --git a/tests/ui/macros/expr_2021_cargo_fix_edition.fixed b/tests/ui/macros/expr_2021_cargo_fix_edition.fixed index 061a4b98033..c0d27609358 100644 --- a/tests/ui/macros/expr_2021_cargo_fix_edition.fixed +++ b/tests/ui/macros/expr_2021_cargo_fix_edition.fixed @@ -1,6 +1,6 @@ //@ run-rustfix //@ check-pass -//@ compile-flags: --edition=2021 +//@ edition: 2021 #![warn(edition_2024_expr_fragment_specifier)] macro_rules! m { diff --git a/tests/ui/macros/expr_2021_cargo_fix_edition.rs b/tests/ui/macros/expr_2021_cargo_fix_edition.rs index cd9cd965fad..b2c16fc7041 100644 --- a/tests/ui/macros/expr_2021_cargo_fix_edition.rs +++ b/tests/ui/macros/expr_2021_cargo_fix_edition.rs @@ -1,6 +1,6 @@ //@ run-rustfix //@ check-pass -//@ compile-flags: --edition=2021 +//@ edition: 2021 #![warn(edition_2024_expr_fragment_specifier)] macro_rules! m { diff --git a/tests/ui/mir/issue-105809.rs b/tests/ui/mir/issue-105809.rs index e7a8fb65268..a46dcf350ad 100644 --- a/tests/ui/mir/issue-105809.rs +++ b/tests/ui/mir/issue-105809.rs @@ -1,7 +1,8 @@ // Non-regression test ICE from issue #105809 and duplicates. //@ build-pass: the ICE is during codegen -//@ compile-flags: --edition 2018 -Zmir-opt-level=1 +//@ compile-flags: -Zmir-opt-level=1 +//@ edition: 2018 use std::{future::Future, pin::Pin}; diff --git a/tests/ui/parser/keyword-try-as-identifier-edition2018.rs b/tests/ui/parser/keyword-try-as-identifier-edition2018.rs index 27452f4d45e..795f32059f2 100644 --- a/tests/ui/parser/keyword-try-as-identifier-edition2018.rs +++ b/tests/ui/parser/keyword-try-as-identifier-edition2018.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 fn main() { let try = "foo"; //~ error: expected identifier, found reserved keyword `try` diff --git a/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs b/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs index dd604b6bf7d..f4f383e008a 100644 --- a/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs +++ b/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs @@ -2,7 +2,8 @@ // trait object type to fail, causing an ICE. // //@ needs-sanitizer-cfi -//@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021 +//@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi +//@ edition: 2021 //@ no-prefer-dynamic //@ only-x86_64-unknown-linux-gnu //@ build-pass diff --git a/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs b/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs index e5b1e032257..7d0c73c2841 100644 --- a/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs +++ b/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs @@ -2,7 +2,8 @@ // encode_ty and caused the compiler to ICE. // //@ needs-sanitizer-cfi -//@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021 +//@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi +//@ edition: 2021 //@ no-prefer-dynamic //@ only-x86_64-unknown-linux-gnu //@ build-pass diff --git a/tests/ui/suggestions/enum-method-probe.fixed b/tests/ui/suggestions/enum-method-probe.fixed index 611be9911d9..e097fa8cc1d 100644 --- a/tests/ui/suggestions/enum-method-probe.fixed +++ b/tests/ui/suggestions/enum-method-probe.fixed @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ edition: 2021 //@ run-rustfix #![allow(unused)] diff --git a/tests/ui/suggestions/enum-method-probe.rs b/tests/ui/suggestions/enum-method-probe.rs index e183ebd25f2..665ee7d0aaa 100644 --- a/tests/ui/suggestions/enum-method-probe.rs +++ b/tests/ui/suggestions/enum-method-probe.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ edition: 2021 //@ run-rustfix #![allow(unused)] diff --git a/tests/ui/suggestions/inner_type.fixed b/tests/ui/suggestions/inner_type.fixed index cfea66b57ec..3dc939d6b5c 100644 --- a/tests/ui/suggestions/inner_type.fixed +++ b/tests/ui/suggestions/inner_type.fixed @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ edition: 2021 //@ run-rustfix pub struct Struct<T> { diff --git a/tests/ui/suggestions/inner_type.rs b/tests/ui/suggestions/inner_type.rs index 5fedf3f256e..81a05c25311 100644 --- a/tests/ui/suggestions/inner_type.rs +++ b/tests/ui/suggestions/inner_type.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ edition: 2021 //@ run-rustfix pub struct Struct<T> { diff --git a/tests/ui/suggestions/issue-86667.rs b/tests/ui/suggestions/issue-86667.rs index 1f37e9a5f6d..cc5b878b632 100644 --- a/tests/ui/suggestions/issue-86667.rs +++ b/tests/ui/suggestions/issue-86667.rs @@ -1,7 +1,7 @@ // Regression test for #86667, where a garbled suggestion was issued for // a missing named lifetime parameter. -//@ compile-flags: --edition 2018 +//@ edition: 2018 async fn a(s1: &str, s2: &str) -> &str { //~^ ERROR: missing lifetime specifier [E0106] diff --git a/tests/ui/traits/issue-85360-eval-obligation-ice.rs b/tests/ui/traits/issue-85360-eval-obligation-ice.rs index 931879a6722..f7c49049e2d 100644 --- a/tests/ui/traits/issue-85360-eval-obligation-ice.rs +++ b/tests/ui/traits/issue-85360-eval-obligation-ice.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ edition: 2021 #![feature(rustc_attrs)] diff --git a/tests/ui/traits/next-solver/opaques/ambig-in-mir-typeck.rs b/tests/ui/traits/next-solver/opaques/ambig-in-mir-typeck.rs index e5208e3e47d..198e6199e92 100644 --- a/tests/ui/traits/next-solver/opaques/ambig-in-mir-typeck.rs +++ b/tests/ui/traits/next-solver/opaques/ambig-in-mir-typeck.rs @@ -1,7 +1,8 @@ // Regression test for #132335. This previously ICE'd due to ambiguity // in MIR typeck. -//@ compile-flags: -Znext-solver=globally --crate-type lib --edition=2018 +//@ compile-flags: -Znext-solver=globally --crate-type lib +//@ edition: 2018 //@ check-pass use core::future::Future; use core::pin::Pin; diff --git a/tests/ui/traits/next-solver/opaques/revealing-use-in-nested-body.rs b/tests/ui/traits/next-solver/opaques/revealing-use-in-nested-body.rs index 8388751fea6..b79926eebda 100644 --- a/tests/ui/traits/next-solver/opaques/revealing-use-in-nested-body.rs +++ b/tests/ui/traits/next-solver/opaques/revealing-use-in-nested-body.rs @@ -3,7 +3,7 @@ // of the async block. This caused borrowck of the recursive // call to ICE. -//@ compile-flags: --edition=2021 +//@ edition: 2021 //@ check-pass async fn test() { Box::pin(test()).await; diff --git a/tests/ui/traits/object/suggestion-trait-object-issue-139174.rs b/tests/ui/traits/object/suggestion-trait-object-issue-139174.rs index f8fa410b7d4..50851a5b0f8 100644 --- a/tests/ui/traits/object/suggestion-trait-object-issue-139174.rs +++ b/tests/ui/traits/object/suggestion-trait-object-issue-139174.rs @@ -1,4 +1,4 @@ -//@compile-flags: --edition 2021 +//@ edition: 2021 fn f<'a>(x: Box<dyn Fn() -> Option<usize + 'a>>) -> usize { //~^ ERROR expected trait, found builtin type `usize` diff --git a/tests/ui/try-block/issue-45124.rs b/tests/ui/try-block/issue-45124.rs index e9e0e767efa..26e1736faac 100644 --- a/tests/ui/try-block/issue-45124.rs +++ b/tests/ui/try-block/issue-45124.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unreachable_code)] -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-bad-lifetime.rs b/tests/ui/try-block/try-block-bad-lifetime.rs index bfff757a2df..9b45b0d9559 100644 --- a/tests/ui/try-block/try-block-bad-lifetime.rs +++ b/tests/ui/try-block/try-block-bad-lifetime.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-bad-type.rs b/tests/ui/try-block/try-block-bad-type.rs index 71eb832dd4e..00cd0af127c 100644 --- a/tests/ui/try-block/try-block-bad-type.rs +++ b/tests/ui/try-block/try-block-bad-type.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-catch.rs b/tests/ui/try-block/try-block-catch.rs index c3aa442ba66..170d5bab3e5 100644 --- a/tests/ui/try-block/try-block-catch.rs +++ b/tests/ui/try-block/try-block-catch.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-in-edition2015.rs b/tests/ui/try-block/try-block-in-edition2015.rs index 423269df12d..4ebe2d31b81 100644 --- a/tests/ui/try-block/try-block-in-edition2015.rs +++ b/tests/ui/try-block/try-block-in-edition2015.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2015 +//@ edition: 2015 pub fn main() { let try_result: Option<_> = try { diff --git a/tests/ui/try-block/try-block-in-match-arm.rs b/tests/ui/try-block/try-block-in-match-arm.rs index cecbf724916..703b1c54bbb 100644 --- a/tests/ui/try-block/try-block-in-match-arm.rs +++ b/tests/ui/try-block/try-block-in-match-arm.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-in-match.rs b/tests/ui/try-block/try-block-in-match.rs index 5c62f41efdb..63a32000f62 100644 --- a/tests/ui/try-block/try-block-in-match.rs +++ b/tests/ui/try-block/try-block-in-match.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-in-return.rs b/tests/ui/try-block/try-block-in-return.rs index ee5ca696b6d..7dc023b90db 100644 --- a/tests/ui/try-block/try-block-in-return.rs +++ b/tests/ui/try-block/try-block-in-return.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-in-while.rs b/tests/ui/try-block/try-block-in-while.rs index 88a97136c59..d6232546cea 100644 --- a/tests/ui/try-block/try-block-in-while.rs +++ b/tests/ui/try-block/try-block-in-while.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-maybe-bad-lifetime.rs b/tests/ui/try-block/try-block-maybe-bad-lifetime.rs index 52ec0c44a05..14adee8944f 100644 --- a/tests/ui/try-block/try-block-maybe-bad-lifetime.rs +++ b/tests/ui/try-block/try-block-maybe-bad-lifetime.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-opt-init.rs b/tests/ui/try-block/try-block-opt-init.rs index fbe7f90d030..55ac5b4a37c 100644 --- a/tests/ui/try-block/try-block-opt-init.rs +++ b/tests/ui/try-block/try-block-opt-init.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-type-error.rs b/tests/ui/try-block/try-block-type-error.rs index 79cdb7a2e48..4e482b40140 100644 --- a/tests/ui/try-block/try-block-type-error.rs +++ b/tests/ui/try-block/try-block-type-error.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-unreachable-code-lint.rs b/tests/ui/try-block/try-block-unreachable-code-lint.rs index 62c74b76d59..9135882a57b 100644 --- a/tests/ui/try-block/try-block-unreachable-code-lint.rs +++ b/tests/ui/try-block/try-block-unreachable-code-lint.rs @@ -1,6 +1,6 @@ // Test unreachable_code lint for `try {}` block ok-wrapping. See issues #54165, #63324. -//@ compile-flags: --edition 2018 +//@ edition: 2018 //@ check-pass #![feature(try_blocks)] #![warn(unreachable_code)] diff --git a/tests/ui/try-block/try-block-unused-delims.fixed b/tests/ui/try-block/try-block-unused-delims.fixed index 348eb8f7965..4769c45d38c 100644 --- a/tests/ui/try-block/try-block-unused-delims.fixed +++ b/tests/ui/try-block/try-block-unused-delims.fixed @@ -1,5 +1,5 @@ //@ check-pass -//@ compile-flags: --edition 2018 +//@ edition: 2018 //@ run-rustfix #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block-unused-delims.rs b/tests/ui/try-block/try-block-unused-delims.rs index f119e1074f6..0520d1d620f 100644 --- a/tests/ui/try-block/try-block-unused-delims.rs +++ b/tests/ui/try-block/try-block-unused-delims.rs @@ -1,5 +1,5 @@ //@ check-pass -//@ compile-flags: --edition 2018 +//@ edition: 2018 //@ run-rustfix #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-block.rs b/tests/ui/try-block/try-block.rs index 7520cbaad37..3fa0d2ba0f2 100644 --- a/tests/ui/try-block/try-block.rs +++ b/tests/ui/try-block/try-block.rs @@ -2,7 +2,7 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] -//@ compile-flags: --edition 2018 +//@ edition: 2018 #![feature(try_blocks)] diff --git a/tests/ui/try-block/try-is-identifier-edition2015.rs b/tests/ui/try-block/try-is-identifier-edition2015.rs index 54bd049442f..99f4d206859 100644 --- a/tests/ui/try-block/try-is-identifier-edition2015.rs +++ b/tests/ui/try-block/try-is-identifier-edition2015.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(non_camel_case_types)] -//@ compile-flags: --edition 2015 +//@ edition: 2015 fn main() { let try = 2; diff --git a/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs b/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs index 4f3f6d37eff..f69fd5747b6 100644 --- a/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs +++ b/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs @@ -1,4 +1,4 @@ -//@ compile-flags: --edition=2021 +//@ edition: 2021 //@ build-pass #![feature(type_alias_impl_trait)] diff --git a/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs b/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs index cad1cbf61a2..736a9dfb490 100644 --- a/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs +++ b/tests/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs @@ -1,4 +1,5 @@ -//@ compile-flags: --edition=2021 --crate-type=lib +//@ compile-flags: --crate-type=lib +//@ edition: 2021 //@ rustc-env:RUST_BACKTRACE=0 //@ check-pass diff --git a/tests/ui/type-alias-impl-trait/issue-93411.rs b/tests/ui/type-alias-impl-trait/issue-93411.rs index 11cbb876631..614d2d0471b 100644 --- a/tests/ui/type-alias-impl-trait/issue-93411.rs +++ b/tests/ui/type-alias-impl-trait/issue-93411.rs @@ -2,7 +2,7 @@ // this test used to stack overflow due to infinite recursion. //@ check-pass -//@ compile-flags: --edition=2018 +//@ edition: 2018 use std::future::Future; diff --git a/tests/ui/type-alias-impl-trait/issue-96572-unconstrained.rs b/tests/ui/type-alias-impl-trait/issue-96572-unconstrained.rs index 08f3c404bed..7f0f6a214aa 100644 --- a/tests/ui/type-alias-impl-trait/issue-96572-unconstrained.rs +++ b/tests/ui/type-alias-impl-trait/issue-96572-unconstrained.rs @@ -1,7 +1,7 @@ #![feature(type_alias_impl_trait)] //@ check-pass //@ revisions: default edition2021 -//@[edition2021] compile-flags: --edition 2021 +//@[edition2021]edition: 2021 fn main() { type T = impl Copy; diff --git a/tests/ui/use/auxiliary/extern-use-primitive-type-lib.rs b/tests/ui/use/auxiliary/extern-use-primitive-type-lib.rs index 18aa329ae36..c21eea743e9 100644 --- a/tests/ui/use/auxiliary/extern-use-primitive-type-lib.rs +++ b/tests/ui/use/auxiliary/extern-use-primitive-type-lib.rs @@ -1,3 +1,3 @@ -//@ compile-flags: --edition=2018 +//@ edition: 2018 pub use u32; |
