about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukas.wirth@ferrous-systems.com>2025-06-02 10:11:10 +0200
committerLukas Wirth <lukas.wirth@ferrous-systems.com>2025-06-02 11:00:46 +0200
commit87054fc811c123cdbe187bf9c5df61302fa29d14 (patch)
treecc787853de49c9848741e79354c4dcc6fb2e135a
parent91fad92585b2dafc52a074e502b2a6c1f093ca35 (diff)
downloadrust-87054fc811c123cdbe187bf9c5df61302fa29d14.tar.gz
rust-87054fc811c123cdbe187bf9c5df61302fa29d14.zip
Add missing 2015 edition directives
These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
-rw-r--r--tests/ui/did_you_mean/E0178.rs1
-rw-r--r--tests/ui/did_you_mean/E0178.stderr8
-rw-r--r--tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs1
-rw-r--r--tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr8
-rw-r--r--tests/ui/editions/async-block-2015.rs1
-rw-r--r--tests/ui/editions/async-block-2015.stderr8
-rw-r--r--tests/ui/ergonomic-clones/async/edition-2015.rs1
-rw-r--r--tests/ui/ergonomic-clones/async/edition-2015.stderr2
-rw-r--r--tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs1
-rw-r--r--tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr4
-rw-r--r--tests/ui/expr/scope.rs1
-rw-r--r--tests/ui/imports/import-glob-crate.rs1
12 files changed, 22 insertions, 15 deletions
diff --git a/tests/ui/did_you_mean/E0178.rs b/tests/ui/did_you_mean/E0178.rs
index 095df640c38..cdaddac35a3 100644
--- a/tests/ui/did_you_mean/E0178.rs
+++ b/tests/ui/did_you_mean/E0178.rs
@@ -1,3 +1,4 @@
+//@ edition:2015
 #![allow(bare_trait_objects)]
 
 trait Foo {}
diff --git a/tests/ui/did_you_mean/E0178.stderr b/tests/ui/did_you_mean/E0178.stderr
index 36e4dbdf7c4..7b69f860381 100644
--- a/tests/ui/did_you_mean/E0178.stderr
+++ b/tests/ui/did_you_mean/E0178.stderr
@@ -1,5 +1,5 @@
 error[E0178]: expected a path on the left-hand side of `+`
-  --> $DIR/E0178.rs:6:8
+  --> $DIR/E0178.rs:7:8
    |
 LL |     w: &'a Foo + Copy,
    |        ^^^^^^^
@@ -10,7 +10,7 @@ LL |     w: &'a (Foo + Copy),
    |            +          +
 
 error[E0178]: expected a path on the left-hand side of `+`
-  --> $DIR/E0178.rs:7:8
+  --> $DIR/E0178.rs:8:8
    |
 LL |     x: &'a Foo + 'a,
    |        ^^^^^^^
@@ -21,7 +21,7 @@ LL |     x: &'a (Foo + 'a),
    |            +        +
 
 error[E0178]: expected a path on the left-hand side of `+`
-  --> $DIR/E0178.rs:8:8
+  --> $DIR/E0178.rs:9:8
    |
 LL |     y: &'a mut Foo + 'a,
    |        ^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL |     y: &'a mut (Foo + 'a),
    |                +        +
 
 error[E0178]: expected a path on the left-hand side of `+`
-  --> $DIR/E0178.rs:9:8
+  --> $DIR/E0178.rs:10:8
    |
 LL |     z: fn() -> Foo + 'a,
    |        ^^^^^^^^^^^-----
diff --git a/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs b/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs
index b7470864a30..eff431f4665 100644
--- a/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs
+++ b/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 #![allow(bare_trait_objects)]
 
 fn main() {
diff --git a/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr b/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr
index 57dbc79a0fd..b051d181ad8 100644
--- a/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr
+++ b/tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr
@@ -1,5 +1,5 @@
 error[E0178]: expected a path on the left-hand side of `+`
-  --> $DIR/trait-object-reference-without-parens-suggestion.rs:4:12
+  --> $DIR/trait-object-reference-without-parens-suggestion.rs:5:12
    |
 LL |     let _: &Copy + 'static;
    |            ^^^^^
@@ -10,7 +10,7 @@ LL |     let _: &(Copy + 'static);
    |             +              +
 
 error[E0178]: expected a path on the left-hand side of `+`
-  --> $DIR/trait-object-reference-without-parens-suggestion.rs:6:12
+  --> $DIR/trait-object-reference-without-parens-suggestion.rs:7:12
    |
 LL |     let _: &'static Copy + 'static;
    |            ^^^^^^^^^^^^^
@@ -21,7 +21,7 @@ LL |     let _: &'static (Copy + 'static);
    |                     +              +
 
 error[E0038]: the trait `Copy` is not dyn compatible
-  --> $DIR/trait-object-reference-without-parens-suggestion.rs:4:13
+  --> $DIR/trait-object-reference-without-parens-suggestion.rs:5:13
    |
 LL |     let _: &Copy + 'static;
    |             ^^^^ `Copy` is not dyn compatible
@@ -31,7 +31,7 @@ LL |     let _: &Copy + 'static;
            for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
 
 error[E0038]: the trait `Copy` is not dyn compatible
-  --> $DIR/trait-object-reference-without-parens-suggestion.rs:6:21
+  --> $DIR/trait-object-reference-without-parens-suggestion.rs:7:21
    |
 LL |     let _: &'static Copy + 'static;
    |                     ^^^^ `Copy` is not dyn compatible
diff --git a/tests/ui/editions/async-block-2015.rs b/tests/ui/editions/async-block-2015.rs
index a079b4aad91..21549f059de 100644
--- a/tests/ui/editions/async-block-2015.rs
+++ b/tests/ui/editions/async-block-2015.rs
@@ -1,3 +1,4 @@
+//@ edition:2015
 async fn foo() {
 //~^ ERROR `async fn` is not permitted in Rust 2015
 //~| NOTE to use `async fn`, switch to Rust 2018 or later
diff --git a/tests/ui/editions/async-block-2015.stderr b/tests/ui/editions/async-block-2015.stderr
index 574bcacc1cf..139df1758cc 100644
--- a/tests/ui/editions/async-block-2015.stderr
+++ b/tests/ui/editions/async-block-2015.stderr
@@ -1,5 +1,5 @@
 error[E0670]: `async fn` is not permitted in Rust 2015
-  --> $DIR/async-block-2015.rs:1:1
+  --> $DIR/async-block-2015.rs:2:1
    |
 LL | async fn foo() {
    | ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -8,7 +8,7 @@ LL | async fn foo() {
    = note: for more on editions, read https://doc.rust-lang.org/edition-guide
 
 error: expected identifier, found keyword `let`
-  --> $DIR/async-block-2015.rs:11:9
+  --> $DIR/async-block-2015.rs:12:9
    |
 LL |     let y = async {
    |             ----- `async` blocks are only allowed in Rust 2018 or later
@@ -19,7 +19,7 @@ LL |         let x = 42;
    = note: for more on editions, read https://doc.rust-lang.org/edition-guide
 
 error: expected identifier, found `42`
-  --> $DIR/async-block-2015.rs:19:9
+  --> $DIR/async-block-2015.rs:20:9
    |
 LL |     let z = async {
    |             ----- `async` blocks are only allowed in Rust 2018 or later
@@ -30,7 +30,7 @@ LL |         42
    = note: for more on editions, read https://doc.rust-lang.org/edition-guide
 
 error[E0422]: cannot find struct, variant or union type `async` in this scope
-  --> $DIR/async-block-2015.rs:7:13
+  --> $DIR/async-block-2015.rs:8:13
    |
 LL |     let x = async {};
    |             ^^^^^ `async` blocks are only allowed in Rust 2018 or later
diff --git a/tests/ui/ergonomic-clones/async/edition-2015.rs b/tests/ui/ergonomic-clones/async/edition-2015.rs
index d3b2071b9f9..78831249429 100644
--- a/tests/ui/ergonomic-clones/async/edition-2015.rs
+++ b/tests/ui/ergonomic-clones/async/edition-2015.rs
@@ -1,3 +1,4 @@
+//@ edition:2015
 #![feature(ergonomic_clones)]
 #![allow(incomplete_features)]
 
diff --git a/tests/ui/ergonomic-clones/async/edition-2015.stderr b/tests/ui/ergonomic-clones/async/edition-2015.stderr
index b218e6b242e..8de90f4bfd3 100644
--- a/tests/ui/ergonomic-clones/async/edition-2015.stderr
+++ b/tests/ui/ergonomic-clones/async/edition-2015.stderr
@@ -1,5 +1,5 @@
 error: `async use` blocks are only allowed in Rust 2018 or later
-  --> $DIR/edition-2015.rs:5:5
+  --> $DIR/edition-2015.rs:6:5
    |
 LL |     async use {};
    |     ^^^^^^^^^
diff --git a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs
index 69a4c13530b..d6bb6466227 100644
--- a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs
+++ b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs
@@ -1,3 +1,4 @@
+//@ edition:2015
 trait MyIterator : Iterator {}
 
 fn main() {
diff --git a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr
index 24f00cfa6be..7f3022c2923 100644
--- a/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr
+++ b/tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr
@@ -1,5 +1,5 @@
 warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
+  --> $DIR/dynless-turbofish-e0191-issue-91997.rs:5:13
    |
 LL |     let _ = MyIterator::next;
    |             ^^^^^^^^^^
@@ -13,7 +13,7 @@ LL |     let _ = <dyn MyIterator>::next;
    |             ++++           +
 
 error[E0191]: the value of the associated type `Item` in `Iterator` must be specified
-  --> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
+  --> $DIR/dynless-turbofish-e0191-issue-91997.rs:5:13
    |
 LL |     let _ = MyIterator::next;
    |             ^^^^^^^^^^ help: specify the associated type: `MyIterator::<Item = Type>`
diff --git a/tests/ui/expr/scope.rs b/tests/ui/expr/scope.rs
index 3a1c8b87da8..b059e43de9e 100644
--- a/tests/ui/expr/scope.rs
+++ b/tests/ui/expr/scope.rs
@@ -1,3 +1,4 @@
+//@ edition:2015
 //@ run-pass
 // Regression test for issue #762
 
diff --git a/tests/ui/imports/import-glob-crate.rs b/tests/ui/imports/import-glob-crate.rs
index 0a2ca6ef2c3..ee067931876 100644
--- a/tests/ui/imports/import-glob-crate.rs
+++ b/tests/ui/imports/import-glob-crate.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-pass
 use std::mem::*;