Skip to content

Commit 46326e1

Browse files
committed
Use non-2015 edition paths in tests that do not test for their resolution
1 parent 81a964c commit 46326e1

Some content is hidden

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

52 files changed

+179
-179
lines changed

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/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/self/self-shadowing-import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod a {
99
}
1010

1111
mod c {
12-
use a::b::a;
12+
use crate::a::b::a;
1313
pub fn bar() { assert_eq!(a::foo(), 1); }
1414
}
1515

tests/ui/sepcomp/auxiliary/sepcomp_lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ pub mod b {
1313
}
1414

1515
pub mod c {
16-
use a::one;
17-
use b::two;
16+
use crate::a::one;
17+
use crate::b::two;
1818
pub fn three() -> usize {
1919
one() + two()
2020
}

tests/ui/sepcomp/sepcomp-extern.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ fn call1() -> usize {
1616

1717
mod a {
1818
pub fn call2() -> usize {
19-
unsafe { ::foo() }
19+
unsafe { crate::foo() }
2020
}
2121
}
2222

2323
mod b {
2424
pub fn call3() -> usize {
25-
unsafe { ::foo() }
25+
unsafe { crate::foo() }
2626
}
2727
}
2828

tests/ui/sepcomp/sepcomp-fns-backwards.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ fn pad() -> usize { 0 }
1212

1313
mod b {
1414
pub fn three() -> usize {
15-
::one() + ::a::two()
15+
crate::one() + crate::a::two()
1616
}
1717
}
1818

1919
mod a {
2020
pub fn two() -> usize {
21-
::one() + ::one()
21+
crate::one() + crate::one()
2222
}
2323
}
2424

tests/ui/sepcomp/sepcomp-fns.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ fn one() -> usize { 1 }
1313

1414
mod a {
1515
pub fn two() -> usize {
16-
::one() + ::one()
16+
crate::one() + crate::one()
1717
}
1818
}
1919

2020
mod b {
2121
pub fn three() -> usize {
22-
::one() + ::a::two()
22+
crate::one() + crate::a::two()
2323
}
2424
}
2525

tests/ui/sepcomp/sepcomp-statics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ mod b {
1515
// that `a` and `b` don't go into the same compilation unit.
1616
fn pad() -> usize { 0 }
1717

18-
pub static THREE: usize = ::ONE + ::a::TWO;
18+
pub static THREE: usize = crate::ONE + crate::a::TWO;
1919
}
2020

2121
mod a {
2222
fn pad() -> usize { 0 }
2323

24-
pub const TWO: usize = ::ONE + ::ONE;
24+
pub const TWO: usize = crate::ONE + crate::ONE;
2525
}
2626

2727
fn main() {

tests/ui/sepcomp/sepcomp-unwind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ mod a {
2626

2727
mod b {
2828
pub fn g() {
29-
::a::f();
29+
crate::a::f();
3030
}
3131
}
3232

3333
fn main() {
34-
thread::spawn(move|| { ::b::g() }).join().unwrap_err();
34+
thread::spawn(move|| { b::g() }).join().unwrap_err();
3535
}

tests/ui/shadowed-use-visibility.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod foo {
55
pub fn f() {}
66

77
pub use self::f as bar;
8-
use foo as bar;
8+
use crate::foo as bar;
99
}
1010

1111
fn main() {

tests/ui/shadowed/shadowed-trait-methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod foo {
55
impl T for () {}
66
}
77

8-
mod bar { pub use foo::T; }
8+
mod bar { pub use crate::foo::T; }
99

1010
fn main() {
1111
pub use bar::*;

0 commit comments

Comments
 (0)