Skip to content

Commit 509ad3c

Browse files
authored
Unrolled build for #142066
Rollup merge of #142066 - ferrocene:lw/edition-2015-tests, r=compiler-errors More simple 2015 edition test decoupling This should be the last of these PRs for now. The remaining tests that do not work on other editions than 2015 either need the range support (so blocked on the MCP), need normalization rules (which needs discussions first/same MCP) or revisions. r? compiler-errors
2 parents 1434630 + 2549962 commit 509ad3c

File tree

109 files changed

+356
-371
lines changed

Some content is hidden

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

109 files changed

+356
-371
lines changed

tests/ui/auxiliary/typeid-intrinsic-aux1.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>);
99
pub type F = Option<isize>;
1010
pub type G = usize;
1111
pub type H = &'static str;
12-
pub type I = Box<Fn()>;
13-
pub type I32Iterator = Iterator<Item=i32>;
14-
pub type U32Iterator = Iterator<Item=u32>;
12+
pub type I = Box<dyn Fn()>;
13+
pub type I32Iterator = dyn Iterator<Item=i32>;
14+
pub type U32Iterator = dyn Iterator<Item=u32>;
1515

1616
pub fn id_A() -> TypeId { TypeId::of::<A>() }
1717
pub fn id_B() -> TypeId { TypeId::of::<B>() }

tests/ui/auxiliary/typeid-intrinsic-aux2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>);
99
pub type F = Option<isize>;
1010
pub type G = usize;
1111
pub type H = &'static str;
12-
pub type I = Box<Fn()>;
13-
pub type I32Iterator = Iterator<Item=i32>;
14-
pub type U32Iterator = Iterator<Item=u32>;
12+
pub type I = Box<dyn Fn()>;
13+
pub type I32Iterator = dyn Iterator<Item=i32>;
14+
pub type U32Iterator = dyn Iterator<Item=u32>;
1515

1616
pub fn id_A() -> TypeId { TypeId::of::<A>() }
1717
pub fn id_B() -> TypeId { TypeId::of::<B>() }

tests/ui/resolve/auxiliary/issue-80079.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![crate_type = "lib"]
22

33
pub mod public {
4-
use private_import;
4+
use crate::private_import;
55

66
// should not be suggested since it is private
77
struct Foo;

tests/ui/resolve/auxiliary/privacy-struct-ctor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pub mod m {
22
pub struct S(u8);
33

44
pub mod n {
5-
pub(in m) struct Z(pub(in m::n) u8);
5+
pub(in crate::m) struct Z(pub(in crate::m::n) u8);
66
}
77
}
88

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/issue-42944.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod foo {
33
}
44

55
mod bar {
6-
use foo::Bx;
6+
use crate::foo::Bx;
77

88
fn foo() {
99
Bx(());

tests/ui/resolve/issue-5035.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ trait I {}
44
type K = dyn I;
55
impl K for isize {} //~ ERROR expected trait, found type alias `K`
66

7-
use ImportError; //~ ERROR unresolved import `ImportError` [E0432]
7+
use crate::ImportError; //~ ERROR unresolved import `crate::ImportError` [E0432]
88
//~^ NOTE no `ImportError` in the root
99
impl ImportError for () {} // check that this is not an additional error (cf. issue #35142)
1010

tests/ui/resolve/issue-5035.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0432]: unresolved import `ImportError`
1+
error[E0432]: unresolved import `crate::ImportError`
22
--> $DIR/issue-5035.rs:7:5
33
|
4-
LL | use ImportError;
5-
| ^^^^^^^^^^^ no `ImportError` in the root
4+
LL | use crate::ImportError;
5+
| ^^^^^^^^^^^^^^^^^^ no `ImportError` in the root
66

77
error[E0404]: expected trait, found type alias `K`
88
--> $DIR/issue-5035.rs:5:6

tests/ui/resolve/privacy-enum-ctor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod m {
88
}
99

1010
pub mod n {
11-
pub(in m) enum Z {
11+
pub(in crate::m) enum Z {
1212
Fn(u8),
1313
Struct {
1414
s: u8,
@@ -17,7 +17,7 @@ mod m {
1717
}
1818
}
1919

20-
use m::n::Z; // OK, only the type is imported
20+
use crate::m::n::Z; // OK, only the type is imported
2121

2222
fn f() {
2323
n::Z;

tests/ui/resolve/privacy-enum-ctor.stderr

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | n::Z;
77
note: the enum is defined here
88
--> $DIR/privacy-enum-ctor.rs:11:9
99
|
10-
LL | / pub(in m) enum Z {
10+
LL | / pub(in crate::m) enum Z {
1111
LL | | Fn(u8),
1212
LL | | Struct {
1313
LL | | s: u8,
@@ -35,7 +35,7 @@ LL | Z;
3535
note: the enum is defined here
3636
--> $DIR/privacy-enum-ctor.rs:11:9
3737
|
38-
LL | / pub(in m) enum Z {
38+
LL | / pub(in crate::m) enum Z {
3939
LL | | Fn(u8),
4040
LL | | Struct {
4141
LL | | s: u8,
@@ -154,8 +154,8 @@ LL | let _: Z = m::n::Z;
154154
note: enum `m::Z` exists but is inaccessible
155155
--> $DIR/privacy-enum-ctor.rs:11:9
156156
|
157-
LL | pub(in m) enum Z {
158-
| ^^^^^^^^^^^^^^^^ not accessible
157+
LL | pub(in crate::m) enum Z {
158+
| ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
159159

160160
error[E0423]: expected value, found enum `m::n::Z`
161161
--> $DIR/privacy-enum-ctor.rs:57:16
@@ -166,7 +166,7 @@ LL | let _: Z = m::n::Z;
166166
note: the enum is defined here
167167
--> $DIR/privacy-enum-ctor.rs:11:9
168168
|
169-
LL | / pub(in m) enum Z {
169+
LL | / pub(in crate::m) enum Z {
170170
LL | | Fn(u8),
171171
LL | | Struct {
172172
LL | | s: u8,
@@ -197,8 +197,8 @@ LL | let _: Z = m::n::Z::Fn;
197197
note: enum `m::Z` exists but is inaccessible
198198
--> $DIR/privacy-enum-ctor.rs:11:9
199199
|
200-
LL | pub(in m) enum Z {
201-
| ^^^^^^^^^^^^^^^^ not accessible
200+
LL | pub(in crate::m) enum Z {
201+
| ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
202202

203203
error[E0412]: cannot find type `Z` in this scope
204204
--> $DIR/privacy-enum-ctor.rs:64:12
@@ -212,8 +212,8 @@ LL | let _: Z = m::n::Z::Struct;
212212
note: enum `m::Z` exists but is inaccessible
213213
--> $DIR/privacy-enum-ctor.rs:11:9
214214
|
215-
LL | pub(in m) enum Z {
216-
| ^^^^^^^^^^^^^^^^ not accessible
215+
LL | pub(in crate::m) enum Z {
216+
| ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
217217

218218
error[E0412]: cannot find type `Z` in this scope
219219
--> $DIR/privacy-enum-ctor.rs:68:12
@@ -227,8 +227,8 @@ LL | let _: Z = m::n::Z::Unit {};
227227
note: enum `m::Z` exists but is inaccessible
228228
--> $DIR/privacy-enum-ctor.rs:11:9
229229
|
230-
LL | pub(in m) enum Z {
231-
| ^^^^^^^^^^^^^^^^ not accessible
230+
LL | pub(in crate::m) enum Z {
231+
| ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
232232

233233
error[E0603]: enum `Z` is private
234234
--> $DIR/privacy-enum-ctor.rs:57:22
@@ -239,8 +239,8 @@ LL | let _: Z = m::n::Z;
239239
note: the enum `Z` is defined here
240240
--> $DIR/privacy-enum-ctor.rs:11:9
241241
|
242-
LL | pub(in m) enum Z {
243-
| ^^^^^^^^^^^^^^^^
242+
LL | pub(in crate::m) enum Z {
243+
| ^^^^^^^^^^^^^^^^^^^^^^^
244244

245245
error[E0603]: enum `Z` is private
246246
--> $DIR/privacy-enum-ctor.rs:61:22
@@ -253,8 +253,8 @@ LL | let _: Z = m::n::Z::Fn;
253253
note: the enum `Z` is defined here
254254
--> $DIR/privacy-enum-ctor.rs:11:9
255255
|
256-
LL | pub(in m) enum Z {
257-
| ^^^^^^^^^^^^^^^^
256+
LL | pub(in crate::m) enum Z {
257+
| ^^^^^^^^^^^^^^^^^^^^^^^
258258

259259
error[E0603]: enum `Z` is private
260260
--> $DIR/privacy-enum-ctor.rs:64:22
@@ -265,8 +265,8 @@ LL | let _: Z = m::n::Z::Struct;
265265
note: the enum `Z` is defined here
266266
--> $DIR/privacy-enum-ctor.rs:11:9
267267
|
268-
LL | pub(in m) enum Z {
269-
| ^^^^^^^^^^^^^^^^
268+
LL | pub(in crate::m) enum Z {
269+
| ^^^^^^^^^^^^^^^^^^^^^^^
270270

271271
error[E0603]: enum `Z` is private
272272
--> $DIR/privacy-enum-ctor.rs:68:22
@@ -279,8 +279,8 @@ LL | let _: Z = m::n::Z::Unit {};
279279
note: the enum `Z` is defined here
280280
--> $DIR/privacy-enum-ctor.rs:11:9
281281
|
282-
LL | pub(in m) enum Z {
283-
| ^^^^^^^^^^^^^^^^
282+
LL | pub(in crate::m) enum Z {
283+
| ^^^^^^^^^^^^^^^^^^^^^^^
284284

285285
error[E0308]: mismatched types
286286
--> $DIR/privacy-enum-ctor.rs:27:20

tests/ui/resolve/privacy-struct-ctor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ mod m {
99
}
1010

1111
pub mod n {
12-
pub(in m) struct Z(pub(in m::n) u8);
12+
pub(in crate::m) struct Z(pub(in crate::m::n) u8);
1313
}
1414

15-
use m::n::Z; // OK, only the type is imported
15+
use crate::m::n::Z; // OK, only the type is imported
1616

1717
fn f() {
1818
n::Z;

tests/ui/resolve/privacy-struct-ctor.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ LL | pub struct S(u8);
4242
error[E0603]: tuple struct constructor `Z` is private
4343
--> $DIR/privacy-struct-ctor.rs:18:12
4444
|
45-
LL | pub(in m) struct Z(pub(in m::n) u8);
46-
| --------------- a constructor is private if any of the fields is private
45+
LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8);
46+
| ---------------------- a constructor is private if any of the fields is private
4747
...
4848
LL | n::Z;
4949
| ^ private tuple struct constructor
5050
|
5151
note: the tuple struct constructor `Z` is defined here
5252
--> $DIR/privacy-struct-ctor.rs:12:9
5353
|
54-
LL | pub(in m) struct Z(pub(in m::n) u8);
55-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54+
LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8);
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5656
help: consider making the field publicly accessible
5757
|
58-
LL - pub(in m) struct Z(pub(in m::n) u8);
59-
LL + pub(in m) struct Z(pub u8);
58+
LL - pub(in crate::m) struct Z(pub(in crate::m::n) u8);
59+
LL + pub(in crate::m) struct Z(pub u8);
6060
|
6161

6262
error[E0603]: tuple struct constructor `S` is private
@@ -100,21 +100,21 @@ LL | pub struct S(pub u8);
100100
error[E0603]: tuple struct constructor `Z` is private
101101
--> $DIR/privacy-struct-ctor.rs:35:11
102102
|
103-
LL | pub(in m) struct Z(pub(in m::n) u8);
104-
| --------------- a constructor is private if any of the fields is private
103+
LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8);
104+
| ---------------------- a constructor is private if any of the fields is private
105105
...
106106
LL | m::n::Z;
107107
| ^ private tuple struct constructor
108108
|
109109
note: the tuple struct constructor `Z` is defined here
110110
--> $DIR/privacy-struct-ctor.rs:12:9
111111
|
112-
LL | pub(in m) struct Z(pub(in m::n) u8);
113-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112+
LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8);
113+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114114
help: consider making the field publicly accessible
115115
|
116-
LL - pub(in m) struct Z(pub(in m::n) u8);
117-
LL + pub(in m) struct Z(pub u8);
116+
LL - pub(in crate::m) struct Z(pub(in crate::m::n) u8);
117+
LL + pub(in crate::m) struct Z(pub u8);
118118
|
119119

120120
error[E0603]: tuple struct constructor `S` is private
@@ -140,16 +140,16 @@ error[E0603]: tuple struct constructor `Z` is private
140140
LL | xcrate::m::n::Z;
141141
| ^ private tuple struct constructor
142142
|
143-
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
143+
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:35
144144
|
145-
LL | pub(in m) struct Z(pub(in m::n) u8);
146-
| --------------- a constructor is private if any of the fields is private
145+
LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8);
146+
| ---------------------- a constructor is private if any of the fields is private
147147
|
148148
note: the tuple struct constructor `Z` is defined here
149149
--> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
150150
|
151-
LL | pub(in m) struct Z(pub(in m::n) u8);
152-
| ^^^^^^^^^^^^^^^^^^
151+
LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8);
152+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
153153

154154
error: aborting due to 10 previous errors
155155

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)]

0 commit comments

Comments
 (0)