Skip to content

Commit 87054fc

Browse files
committed
Add missing 2015 edition directives
These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
1 parent 91fad92 commit 87054fc

12 files changed

+22
-15
lines changed

tests/ui/did_you_mean/E0178.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition:2015
12
#![allow(bare_trait_objects)]
23

34
trait Foo {}

tests/ui/did_you_mean/E0178.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0178]: expected a path on the left-hand side of `+`
2-
--> $DIR/E0178.rs:6:8
2+
--> $DIR/E0178.rs:7:8
33
|
44
LL | w: &'a Foo + Copy,
55
| ^^^^^^^
@@ -10,7 +10,7 @@ LL | w: &'a (Foo + Copy),
1010
| + +
1111

1212
error[E0178]: expected a path on the left-hand side of `+`
13-
--> $DIR/E0178.rs:7:8
13+
--> $DIR/E0178.rs:8:8
1414
|
1515
LL | x: &'a Foo + 'a,
1616
| ^^^^^^^
@@ -21,7 +21,7 @@ LL | x: &'a (Foo + 'a),
2121
| + +
2222

2323
error[E0178]: expected a path on the left-hand side of `+`
24-
--> $DIR/E0178.rs:8:8
24+
--> $DIR/E0178.rs:9:8
2525
|
2626
LL | y: &'a mut Foo + 'a,
2727
| ^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL | y: &'a mut (Foo + 'a),
3232
| + +
3333

3434
error[E0178]: expected a path on the left-hand side of `+`
35-
--> $DIR/E0178.rs:9:8
35+
--> $DIR/E0178.rs:10:8
3636
|
3737
LL | z: fn() -> Foo + 'a,
3838
| ^^^^^^^^^^^-----

tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition: 2015
12
#![allow(bare_trait_objects)]
23

34
fn main() {

tests/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0178]: expected a path on the left-hand side of `+`
2-
--> $DIR/trait-object-reference-without-parens-suggestion.rs:4:12
2+
--> $DIR/trait-object-reference-without-parens-suggestion.rs:5:12
33
|
44
LL | let _: &Copy + 'static;
55
| ^^^^^
@@ -10,7 +10,7 @@ LL | let _: &(Copy + 'static);
1010
| + +
1111

1212
error[E0178]: expected a path on the left-hand side of `+`
13-
--> $DIR/trait-object-reference-without-parens-suggestion.rs:6:12
13+
--> $DIR/trait-object-reference-without-parens-suggestion.rs:7:12
1414
|
1515
LL | let _: &'static Copy + 'static;
1616
| ^^^^^^^^^^^^^
@@ -21,7 +21,7 @@ LL | let _: &'static (Copy + 'static);
2121
| + +
2222

2323
error[E0038]: the trait `Copy` is not dyn compatible
24-
--> $DIR/trait-object-reference-without-parens-suggestion.rs:4:13
24+
--> $DIR/trait-object-reference-without-parens-suggestion.rs:5:13
2525
|
2626
LL | let _: &Copy + 'static;
2727
| ^^^^ `Copy` is not dyn compatible
@@ -31,7 +31,7 @@ LL | let _: &Copy + 'static;
3131
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
3232

3333
error[E0038]: the trait `Copy` is not dyn compatible
34-
--> $DIR/trait-object-reference-without-parens-suggestion.rs:6:21
34+
--> $DIR/trait-object-reference-without-parens-suggestion.rs:7:21
3535
|
3636
LL | let _: &'static Copy + 'static;
3737
| ^^^^ `Copy` is not dyn compatible

tests/ui/editions/async-block-2015.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition:2015
12
async fn foo() {
23
//~^ ERROR `async fn` is not permitted in Rust 2015
34
//~| NOTE to use `async fn`, switch to Rust 2018 or later

tests/ui/editions/async-block-2015.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0670]: `async fn` is not permitted in Rust 2015
2-
--> $DIR/async-block-2015.rs:1:1
2+
--> $DIR/async-block-2015.rs:2:1
33
|
44
LL | async fn foo() {
55
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -8,7 +8,7 @@ LL | async fn foo() {
88
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
99

1010
error: expected identifier, found keyword `let`
11-
--> $DIR/async-block-2015.rs:11:9
11+
--> $DIR/async-block-2015.rs:12:9
1212
|
1313
LL | let y = async {
1414
| ----- `async` blocks are only allowed in Rust 2018 or later
@@ -19,7 +19,7 @@ LL | let x = 42;
1919
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
2020

2121
error: expected identifier, found `42`
22-
--> $DIR/async-block-2015.rs:19:9
22+
--> $DIR/async-block-2015.rs:20:9
2323
|
2424
LL | let z = async {
2525
| ----- `async` blocks are only allowed in Rust 2018 or later
@@ -30,7 +30,7 @@ LL | 42
3030
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
3131

3232
error[E0422]: cannot find struct, variant or union type `async` in this scope
33-
--> $DIR/async-block-2015.rs:7:13
33+
--> $DIR/async-block-2015.rs:8:13
3434
|
3535
LL | let x = async {};
3636
| ^^^^^ `async` blocks are only allowed in Rust 2018 or later

tests/ui/ergonomic-clones/async/edition-2015.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition:2015
12
#![feature(ergonomic_clones)]
23
#![allow(incomplete_features)]
34

tests/ui/ergonomic-clones/async/edition-2015.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `async use` blocks are only allowed in Rust 2018 or later
2-
--> $DIR/edition-2015.rs:5:5
2+
--> $DIR/edition-2015.rs:6:5
33
|
44
LL | async use {};
55
| ^^^^^^^^^

tests/ui/errors/dynless-turbofish-e0191-issue-91997.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition:2015
12
trait MyIterator : Iterator {}
23

34
fn main() {

tests/ui/errors/dynless-turbofish-e0191-issue-91997.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: trait objects without an explicit `dyn` are deprecated
2-
--> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
2+
--> $DIR/dynless-turbofish-e0191-issue-91997.rs:5:13
33
|
44
LL | let _ = MyIterator::next;
55
| ^^^^^^^^^^
@@ -13,7 +13,7 @@ LL | let _ = <dyn MyIterator>::next;
1313
| ++++ +
1414

1515
error[E0191]: the value of the associated type `Item` in `Iterator` must be specified
16-
--> $DIR/dynless-turbofish-e0191-issue-91997.rs:4:13
16+
--> $DIR/dynless-turbofish-e0191-issue-91997.rs:5:13
1717
|
1818
LL | let _ = MyIterator::next;
1919
| ^^^^^^^^^^ help: specify the associated type: `MyIterator::<Item = Type>`

tests/ui/expr/scope.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition:2015
12
//@ run-pass
23
// Regression test for issue #762
34

tests/ui/imports/import-glob-crate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition: 2015
12
//@ run-pass
23
use std::mem::*;
34

0 commit comments

Comments
 (0)