Skip to content

Commit 1d7c1b1

Browse files
committed
Add more missing 2015 edition directives
1 parent 46326e1 commit 1d7c1b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+90
-63
lines changed

tests/ui/resolve/extern-prelude-fail.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition: 2015
12
//@ compile-flags:--extern extern_prelude
23
//@ aux-build:extern-prelude.rs
34

tests/ui/resolve/extern-prelude-fail.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0432]: unresolved import `extern_prelude`
2-
--> $DIR/extern-prelude-fail.rs:7:9
2+
--> $DIR/extern-prelude-fail.rs:8:9
33
|
44
LL | use extern_prelude::S;
55
| ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
@@ -10,7 +10,7 @@ LL + extern crate extern_prelude;
1010
|
1111

1212
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `extern_prelude`
13-
--> $DIR/extern-prelude-fail.rs:8:15
13+
--> $DIR/extern-prelude-fail.rs:9:15
1414
|
1515
LL | let s = ::extern_prelude::S;
1616
| ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`

tests/ui/resolve/resolve-bad-visibility.rs

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

tests/ui/resolve/resolve-bad-visibility.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0577]: expected module, found enum `E`
2-
--> $DIR/resolve-bad-visibility.rs:4:8
2+
--> $DIR/resolve-bad-visibility.rs:5:8
33
|
44
LL | pub(in E) struct S;
55
| ^ not a module
66

77
error[E0577]: expected module, found trait `Tr`
8-
--> $DIR/resolve-bad-visibility.rs:5:8
8+
--> $DIR/resolve-bad-visibility.rs:6:8
99
|
1010
LL | pub(in Tr) struct Z;
1111
| ^^ not a module
1212

1313
error[E0742]: visibilities can only be restricted to ancestor modules
14-
--> $DIR/resolve-bad-visibility.rs:6:8
14+
--> $DIR/resolve-bad-visibility.rs:7:8
1515
|
1616
LL | pub(in std::vec) struct F;
1717
| ^^^^^^^^
1818

1919
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
20-
--> $DIR/resolve-bad-visibility.rs:7:8
20+
--> $DIR/resolve-bad-visibility.rs:8:8
2121
|
2222
LL | pub(in nonexistent) struct G;
2323
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
@@ -28,7 +28,7 @@ LL + extern crate nonexistent;
2828
|
2929

3030
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `too_soon`
31-
--> $DIR/resolve-bad-visibility.rs:8:8
31+
--> $DIR/resolve-bad-visibility.rs:9:8
3232
|
3333
LL | pub(in too_soon) struct H;
3434
| ^^^^^^^^ use of unresolved module or unlinked crate `too_soon`

tests/ui/resolve/suggest-builder-fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Bar {
3232
}
3333

3434
mod SomeMod {
35-
use Bar;
35+
use crate::Bar;
3636

3737
impl Bar {
3838
// Public method. Should be suggested

tests/ui/resolve/unresolved-segments-visibility.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ extern crate alloc as b;
55

66
mod foo {
77
mod bar {
8-
pub(in b::string::String::newy) extern crate alloc as e;
8+
pub(in crate::b::string::String::newy) extern crate alloc as e;
99
//~^ ERROR failed to resolve: `String` is a struct, not a module [E0433]
1010
}
1111
}

tests/ui/resolve/unresolved-segments-visibility.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0433]: failed to resolve: `String` is a struct, not a module
2-
--> $DIR/unresolved-segments-visibility.rs:8:27
2+
--> $DIR/unresolved-segments-visibility.rs:8:34
33
|
4-
LL | pub(in b::string::String::newy) extern crate alloc as e;
5-
| ^^^^^^ `String` is a struct, not a module
4+
LL | pub(in crate::b::string::String::newy) extern crate alloc as e;
5+
| ^^^^^^ `String` is a struct, not a module
66

77
error: aborting due to 1 previous error
88

tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition: 2015
12
//@ run-rustfix
23

34
#![deny(absolute_paths_not_starting_with_crate)]

tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//@ edition: 2015
12
//@ run-rustfix
23

34
#![deny(absolute_paths_not_starting_with_crate)]

tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
2-
--> $DIR/edition-lint-fully-qualified-paths.rs:18:25
2+
--> $DIR/edition-lint-fully-qualified-paths.rs:19:25
33
|
44
LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
55
| ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo`
66
|
77
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
88
= note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
99
note: the lint level is defined here
10-
--> $DIR/edition-lint-fully-qualified-paths.rs:3:9
10+
--> $DIR/edition-lint-fully-qualified-paths.rs:4:9
1111
|
1212
LL | #![deny(absolute_paths_not_starting_with_crate)]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
16-
--> $DIR/edition-lint-fully-qualified-paths.rs:18:25
16+
--> $DIR/edition-lint-fully-qualified-paths.rs:19:25
1717
|
1818
LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
1919
| ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo`
@@ -23,7 +23,7 @@ LL | let _: <foo::Baz as ::foo::Foo>::Bar = ();
2323
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2424

2525
error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
26-
--> $DIR/edition-lint-fully-qualified-paths.rs:24:13
26+
--> $DIR/edition-lint-fully-qualified-paths.rs:25:13
2727
|
2828
LL | let _: <::foo::Baz as foo::Foo>::Bar = ();
2929
| ^^^^^^^^^^ help: use `crate`: `crate::foo::Baz`

0 commit comments

Comments
 (0)