Skip to content

Commit be2d382

Browse files
authored
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 9ec41bc + eae7fe1 commit be2d382

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
|

0 commit comments

Comments
 (0)