Skip to content

Commit a1f008c

Browse files
authored
Unrolled build for #141960
Rollup merge of #141960 - ferrocene:lw/2015-paths2, r=compiler-errors Use non-2015 edition paths in tests that do not test for their resolution This allows for testing these tests on editions other than 2015 Follow up to #141888
2 parents ff223d3 + eae7fe1 commit a1f008c

Some content is hidden

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

58 files changed

+290
-290
lines changed

tests/ui/issues/issue-20427.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ mod reuse {
5959

6060
pub fn check<u16>() {
6161
assert_eq!(size_of::<u8>(), 8);
62-
assert_eq!(size_of::<::u64>(), 0);
62+
assert_eq!(size_of::<crate::u64>(), 0);
6363
assert_eq!(size_of::<i16>(), 3 * size_of::<*const ()>());
6464
assert_eq!(size_of::<u16>(), 0);
6565
}

tests/ui/issues/issue-28983.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ impl Test for u32 {
77

88
pub mod export {
99
#[no_mangle]
10-
pub extern "C" fn issue_28983(t: <u32 as ::Test>::T) -> i32 { t*3 }
10+
pub extern "C" fn issue_28983(t: <u32 as crate::Test>::T) -> i32 { t*3 }
1111
}
1212

1313
// to test both exporting and importing functions, import

tests/ui/issues/issue-31776.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct S;
88

99
mod m {
1010
fn f() {
11-
impl ::S {
11+
impl crate::S {
1212
pub fn s(&self) {}
1313
}
1414
}
@@ -24,7 +24,7 @@ pub struct S1;
2424
fn f() {
2525
pub struct Z;
2626

27-
impl ::Tr for ::S1 {
27+
impl crate::Tr for crate::S1 {
2828
type A = Z; // Private-in-public error unless `struct Z` is pub
2929
}
3030
}
@@ -43,7 +43,7 @@ mod m1 {
4343
pub field: u8
4444
}
4545

46-
impl ::Tr1 for ::S2 {
46+
impl crate::Tr1 for crate::S2 {
4747
type A = Z;
4848
fn pull(&self) -> Self::A { Z{field: 10} }
4949
}

tests/ui/issues/issue-32797.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod bar {
77

88
pub use baz::*;
99
mod baz {
10-
pub use main as f;
10+
pub use crate::main as f;
1111
}
1212

1313
pub fn main() {}

tests/ui/issues/issue-41053.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl Iterator for Foo {
1111
type Item = Box<dyn Trait>;
1212
fn next(&mut self) -> Option<Box<dyn Trait>> {
1313
extern crate issue_41053;
14-
impl ::Trait for issue_41053::Test {
14+
impl crate::Trait for issue_41053::Test {
1515
fn foo(&self) {}
1616
}
1717
Some(Box::new(issue_41053::Test))

tests/ui/issues/issue-47364.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ pub enum IResult<I,O> {
1818
Incomplete(u32, u64)
1919
}
2020

21-
pub fn multispace<T: Copy>(input: T) -> ::IResult<i8, i8> {
22-
::IResult::Done(0, 0)
21+
pub fn multispace<T: Copy>(input: T) -> crate::IResult<i8, i8> {
22+
crate::IResult::Done(0, 0)
2323
}
2424

2525
mod nom_sql {
26-
fn where_clause(i: &[u8]) -> ::IResult<&[u8], Option<String>> {
27-
let X = match ::multispace(i) {
28-
::IResult::Done(..) => ::IResult::Done(i, None::<String>),
29-
_ => ::IResult::Error(::Err::NodePosition(0)),
26+
fn where_clause(i: &[u8]) -> crate::IResult<&[u8], Option<String>> {
27+
let X = match crate::multispace(i) {
28+
crate::IResult::Done(..) => crate::IResult::Done(i, None::<String>),
29+
_ => crate::IResult::Error(crate::Err::NodePosition(0)),
3030
};
3131
match X {
32-
::IResult::Done(_, _) => ::IResult::Done(i, None),
32+
crate::IResult::Done(_, _) => crate::IResult::Done(i, None),
3333
_ => X
3434
}
3535
}
@@ -39,16 +39,16 @@ mod nom_sql {
3939
match {
4040
where_clause(i)
4141
} {
42-
::IResult::Done(_, o) => ::IResult::Done(i, Some(o)),
43-
::IResult::Error(_) => ::IResult::Done(i, None),
44-
_ => ::IResult::Incomplete(0, 0),
42+
crate::IResult::Done(_, o) => crate::IResult::Done(i, Some(o)),
43+
crate::IResult::Error(_) => crate::IResult::Done(i, None),
44+
_ => crate::IResult::Incomplete(0, 0),
4545
}
4646
} {
47-
::IResult::Done(z, _) => ::IResult::Done(z, None::<String>),
47+
crate::IResult::Done(z, _) => crate::IResult::Done(z, None::<String>),
4848
_ => return ()
4949
};
5050
match Y {
51-
::IResult::Done(x, _) => {
51+
crate::IResult::Done(x, _) => {
5252
let bytes = b"; ";
5353
let len = x.len();
5454
bytes[len];

tests/ui/issues/issue-50187.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ mod macro_ns {
1313
}
1414

1515
mod merge2 {
16-
pub use type_ns::A;
17-
pub use value_ns::A;
16+
pub use crate::type_ns::A;
17+
pub use crate::value_ns::A;
1818
}
1919
mod merge3 {
20-
pub use type_ns::A;
21-
pub use value_ns::A;
22-
pub use macro_ns::A;
20+
pub use crate::type_ns::A;
21+
pub use crate::value_ns::A;
22+
pub use crate::macro_ns::A;
2323
}
2424

2525
mod use2 {
26-
pub use merge2::A;
26+
pub use crate::merge2::A;
2727
}
2828
mod use3 {
29-
pub use merge3::A;
29+
pub use crate::merge3::A;
3030
}
3131

3232
fn main() {

tests/ui/issues/issue-50761.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mod b {
1414
}
1515

1616
impl Builder {
17-
pub fn with_a(&mut self, _a: fn() -> dyn (::a::A)) {}
17+
pub fn with_a(&mut self, _a: fn() -> dyn (crate::a::A)) {}
1818
}
1919
}
2020

tests/ui/issues/issue-6936.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
struct T;
22

33
mod t1 {
4-
type Foo = ::T;
4+
type Foo = crate::T;
55
mod Foo {} //~ ERROR the name `Foo` is defined multiple times
66
}
77

88
mod t2 {
9-
type Foo = ::T;
9+
type Foo = crate::T;
1010
struct Foo; //~ ERROR the name `Foo` is defined multiple times
1111
}
1212

1313
mod t3 {
14-
type Foo = ::T;
14+
type Foo = crate::T;
1515
enum Foo {} //~ ERROR the name `Foo` is defined multiple times
1616
}
1717

1818
mod t4 {
19-
type Foo = ::T;
19+
type Foo = crate::T;
2020
fn Foo() {} // ok
2121
}
2222

@@ -26,7 +26,7 @@ mod t5 {
2626
}
2727

2828
mod t6 {
29-
type Foo = ::T;
29+
type Foo = crate::T;
3030
impl Foo {} // ok
3131
}
3232

tests/ui/issues/issue-6936.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0428]: the name `Foo` is defined multiple times
22
--> $DIR/issue-6936.rs:5:5
33
|
4-
LL | type Foo = ::T;
5-
| --------------- previous definition of the type `Foo` here
4+
LL | type Foo = crate::T;
5+
| -------------------- previous definition of the type `Foo` here
66
LL | mod Foo {}
77
| ^^^^^^^ `Foo` redefined here
88
|
@@ -11,8 +11,8 @@ LL | mod Foo {}
1111
error[E0428]: the name `Foo` is defined multiple times
1212
--> $DIR/issue-6936.rs:10:5
1313
|
14-
LL | type Foo = ::T;
15-
| --------------- previous definition of the type `Foo` here
14+
LL | type Foo = crate::T;
15+
| -------------------- previous definition of the type `Foo` here
1616
LL | struct Foo;
1717
| ^^^^^^^^^^^ `Foo` redefined here
1818
|
@@ -21,8 +21,8 @@ LL | struct Foo;
2121
error[E0428]: the name `Foo` is defined multiple times
2222
--> $DIR/issue-6936.rs:15:5
2323
|
24-
LL | type Foo = ::T;
25-
| --------------- previous definition of the type `Foo` here
24+
LL | type Foo = crate::T;
25+
| -------------------- previous definition of the type `Foo` here
2626
LL | enum Foo {}
2727
| ^^^^^^^^ `Foo` redefined here
2828
|

tests/ui/issues/issue-7663.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod test1 {
88
mod bar { pub fn p() -> isize { 2 } }
99

1010
pub mod baz {
11-
use test1::bar::p;
11+
use crate::test1::bar::p;
1212

1313
pub fn my_main() { assert_eq!(p(), 2); }
1414
}
@@ -20,7 +20,7 @@ mod test2 {
2020
mod bar { pub fn p() -> isize { 2 } }
2121

2222
pub mod baz {
23-
use test2::bar::p;
23+
use crate::test2::bar::p;
2424

2525
pub fn my_main() { assert_eq!(p(), 2); }
2626
}

tests/ui/lint/lint-directives-on-use-items-issue-10534.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
mod a { pub static x: isize = 3; pub static y: isize = 4; }
1010

1111
mod b {
12-
use a::x; //~ ERROR: unused import
12+
use crate::a::x; //~ ERROR: unused import
1313
#[allow(unused_imports)]
14-
use a::y; // no error here
14+
use crate::a::y; // no error here
1515
}
1616

1717
#[allow(unused_imports)]
1818
mod c {
19-
use a::x;
19+
use crate::a::x;
2020
#[deny(unused_imports)]
21-
use a::y; //~ ERROR: unused import
21+
use crate::a::y; //~ ERROR: unused import
2222
}
2323

2424
fn main() {}

tests/ui/lint/lint-directives-on-use-items-issue-10534.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
error: unused import: `a::x`
1+
error: unused import: `crate::a::x`
22
--> $DIR/lint-directives-on-use-items-issue-10534.rs:12:9
33
|
4-
LL | use a::x;
5-
| ^^^^
4+
LL | use crate::a::x;
5+
| ^^^^^^^^^^^
66
|
77
note: the lint level is defined here
88
--> $DIR/lint-directives-on-use-items-issue-10534.rs:1:9
99
|
1010
LL | #![deny(unused_imports)]
1111
| ^^^^^^^^^^^^^^
1212

13-
error: unused import: `a::y`
13+
error: unused import: `crate::a::y`
1414
--> $DIR/lint-directives-on-use-items-issue-10534.rs:21:9
1515
|
16-
LL | use a::y;
17-
| ^^^^
16+
LL | use crate::a::y;
17+
| ^^^^^^^^^^^
1818
|
1919
note: the lint level is defined here
2020
--> $DIR/lint-directives-on-use-items-issue-10534.rs:20:12

tests/ui/lint/lint-missing-doc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ mod internal_impl {
184184
}
185185
/// dox
186186
pub mod public_interface {
187-
pub use internal_impl::documented as foo;
188-
pub use internal_impl::undocumented1 as bar;
189-
pub use internal_impl::{documented, undocumented2};
190-
pub use internal_impl::globbed::*;
187+
pub use crate::internal_impl::documented as foo;
188+
pub use crate::internal_impl::undocumented1 as bar;
189+
pub use crate::internal_impl::{documented, undocumented2};
190+
pub use crate::internal_impl::globbed::*;
191191
}
192192

193193
extern "C" {

tests/ui/lint/lint-unnecessary-import-braces.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![deny(unused_import_braces)]
22

3-
use test::{A}; //~ ERROR braces around A is unnecessary
3+
use crate::test::{A}; //~ ERROR braces around A is unnecessary
44

55
mod test {
6-
use test::{self}; // OK
7-
use test::{self as rename}; // OK
6+
use crate::test::{self}; // OK
7+
use crate::test::{self as rename}; // OK
88
pub struct A;
99
}
1010

tests/ui/lint/lint-unnecessary-import-braces.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: braces around A is unnecessary
22
--> $DIR/lint-unnecessary-import-braces.rs:3:1
33
|
4-
LL | use test::{A};
5-
| ^^^^^^^^^^^^^^
4+
LL | use crate::test::{A};
5+
| ^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: the lint level is defined here
88
--> $DIR/lint-unnecessary-import-braces.rs:1:9

tests/ui/lint/unused/lint-unused-imports.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub mod bar {
4848
pub struct Square;
4949

5050
pub mod c {
51-
use foo::Point;
52-
use foo::Square; //~ ERROR unused import: `foo::Square`
51+
use crate::foo::Point;
52+
use crate::foo::Square; //~ ERROR unused import: `crate::foo::Square`
5353
pub fn cc(_p: Point) -> super::Square {
5454
fn f() -> super::Square {
5555
super::Square
@@ -74,7 +74,7 @@ fn g() {
7474
// cf. issue #35135.
7575
#[allow(unused_variables)]
7676
fn h() {
77-
use test2::foo; //~ ERROR unused import: `test2::foo`
77+
use crate::test2::foo; //~ ERROR unused import: `crate::test2::foo`
7878
let foo = 0;
7979
}
8080

@@ -83,6 +83,6 @@ fn main() {
8383
let mut a = 3;
8484
let mut b = 4;
8585
swap(&mut a, &mut b);
86-
test::C.b();
86+
crate::test::C.b();
8787
foo();
8888
}

tests/ui/lint/unused/lint-unused-imports.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ error: unused import: `bar`
2828
LL | use test2::{foo, bar};
2929
| ^^^
3030

31-
error: unused import: `foo::Square`
31+
error: unused import: `crate::foo::Square`
3232
--> $DIR/lint-unused-imports.rs:52:13
3333
|
34-
LL | use foo::Square;
35-
| ^^^^^^^^^^^
34+
LL | use crate::foo::Square;
35+
| ^^^^^^^^^^^^^^^^^^
3636

3737
error: unused import: `self::g`
3838
--> $DIR/lint-unused-imports.rs:68:9
3939
|
4040
LL | use self::g;
4141
| ^^^^^^^
4242

43-
error: unused import: `test2::foo`
43+
error: unused import: `crate::test2::foo`
4444
--> $DIR/lint-unused-imports.rs:77:9
4545
|
46-
LL | use test2::foo;
47-
| ^^^^^^^^^^
46+
LL | use crate::test2::foo;
47+
| ^^^^^^^^^^^^^^^^^
4848

4949
error: unused import: `test::B2`
5050
--> $DIR/lint-unused-imports.rs:20:5

0 commit comments

Comments
 (0)