Skip to content

Commit add4bde

Browse files
authored
Rollup merge of rust-lang#141888 - ferrocene:lw/decouple-tests-from-2015, 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
2 parents e63e53a + 23d5231 commit add4bde

Some content is hidden

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

64 files changed

+194
-193
lines changed

tests/ui/autoref-autoderef/autoderef-privacy.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@ impl Bar2 {
1414

1515
mod foo {
1616
#[derive(Default)]
17-
pub struct Bar { i: ::Bar2 }
17+
pub struct Bar { i: crate::Bar2 }
1818
#[derive(Default)]
19-
pub struct Baz(::Baz2);
19+
pub struct Baz(crate::Baz2);
2020

2121
impl Bar {
2222
fn f(&self) -> bool { false }
2323
}
2424

2525
impl ::std::ops::Deref for Bar {
26-
type Target = ::Bar2;
27-
fn deref(&self) -> &::Bar2 { &self.i }
26+
type Target = crate::Bar2;
27+
fn deref(&self) -> &crate::Bar2 { &self.i }
2828
}
2929

3030
impl ::std::ops::Deref for Baz {
31-
type Target = ::Baz2;
32-
fn deref(&self) -> &::Baz2 { &self.0 }
31+
type Target = crate::Baz2;
32+
fn deref(&self) -> &crate::Baz2 { &self.0 }
3333
}
3434

3535
pub fn f(bar: &Bar, baz: &Baz) {
3636
// Since the private fields and methods are visible here, there should be no autoderefs.
37-
let _: &::Bar2 = &bar.i;
38-
let _: &::Baz2 = &baz.0;
37+
let _: &crate::Bar2 = &bar.i;
38+
let _: &crate::Baz2 = &baz.0;
3939
assert!(!bar.f());
4040
}
4141
}

tests/ui/auxiliary/crate-method-reexport-grrrrrrr2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub mod name_pool {
1616
}
1717

1818
pub mod rust {
19-
pub use name_pool::add;
19+
pub use crate::name_pool::add;
2020

2121
pub type rt = Box<()>;
2222

tests/ui/auxiliary/pub-and-stability.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mod m {
4444
#[unstable(feature = "unstable_undeclared", issue = "38412")] // SILLY
4545
pub(crate) b_crate: i32,
4646
#[unstable(feature = "unstable_declared", issue = "38412")] // SILLY
47-
pub(in m) c_mod: i32,
47+
pub(in crate::m) c_mod: i32,
4848
#[stable(feature = "unit_test", since = "1.0.0")] // SILLY
4949
d_priv: i32
5050
}
@@ -60,7 +60,7 @@ mod m {
6060
pub i32,
6161

6262
pub(crate) i32,
63-
pub(in m) i32,
63+
pub(in crate::m) i32,
6464
i32);
6565

6666
impl Record {
@@ -113,7 +113,7 @@ mod m {
113113
#[unstable(feature = "unstable_undeclared", issue = "38412")] // SILLY
114114
pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
115115
#[unstable(feature = "unstable_declared", issue = "38412")] // SILLY
116-
pub(in m) fn pub_mod(&self) -> i32 { self.d_priv }
116+
pub(in crate::m) fn pub_mod(&self) -> i32 { self.d_priv }
117117
#[stable(feature = "unit_test", since = "1.0.0")] // SILLY
118118
fn private(&self) -> i32 { self.d_priv }
119119
}
@@ -127,7 +127,7 @@ mod m {
127127
pub fn stable(&self) -> i32 { self.0 }
128128

129129
pub(crate) fn pub_crate(&self) -> i32 { self.0 }
130-
pub(in m) fn pub_mod(&self) -> i32 { self.0 }
130+
pub(in crate::m) fn pub_mod(&self) -> i32 { self.0 }
131131
fn private(&self) -> i32 { self.0 }
132132
}
133133
}

tests/ui/coherence/coherence_inherent.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ mod Lib {
1515

1616
mod Import {
1717
// Trait is in scope here:
18-
use Lib::TheStruct;
19-
use Lib::TheTrait;
18+
use crate::Lib::TheStruct;
19+
use crate::Lib::TheTrait;
2020

2121
fn call_the_fn(s: &TheStruct) {
2222
s.the_fn();
@@ -25,7 +25,7 @@ mod Import {
2525

2626
mod NoImport {
2727
// Trait is not in scope here:
28-
use Lib::TheStruct;
28+
use crate::Lib::TheStruct;
2929

3030
fn call_the_fn(s: &TheStruct) {
3131
s.the_fn();

tests/ui/consts/const-blocks/migrate-fail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
struct Bar;
55

66
mod non_constants {
7-
use Bar;
7+
use crate::Bar;
88

99
fn no_impl_copy_empty_value_multiple_elements() {
1010
let x = None;

tests/ui/consts/const-blocks/migrate-pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
struct Bar;
66

77
mod constants {
8-
use Bar;
8+
use crate::Bar;
99

1010
fn no_impl_copy_empty_value_no_elements() {
1111
const FOO: Option<Bar> = None;
@@ -69,7 +69,7 @@ mod constants {
6969
}
7070

7171
mod non_constants {
72-
use Bar;
72+
use crate::Bar;
7373

7474
fn no_impl_copy_empty_value_no_elements() {
7575
let x = None;

tests/ui/consts/const-blocks/nll-fail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
struct Bar;
55

66
mod non_constants {
7-
use Bar;
7+
use crate::Bar;
88

99
fn no_impl_copy_empty_value_multiple_elements() {
1010
let x = None;

tests/ui/consts/const-blocks/nll-pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
struct Bar;
66

77
mod constants {
8-
use Bar;
8+
use crate::Bar;
99

1010
fn no_impl_copy_empty_value_no_elements() {
1111
const FOO: Option<Bar> = None;
@@ -69,7 +69,7 @@ mod constants {
6969
}
7070

7171
mod non_constants {
72-
use Bar;
72+
use crate::Bar;
7373

7474
fn no_impl_copy_empty_value_no_elements() {
7575
let x = None;

tests/ui/cross-crate/auxiliary/static_priv_by_default.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ mod foo {
3131
}
3232

3333
pub mod bar {
34-
pub use foo::reexported_a as e;
35-
pub use foo::reexported_b as f;
36-
pub use foo::reexported_c as g;
37-
pub use foo::reexported_d as h;
38-
pub use foo::reexported_e as i;
34+
pub use crate::foo::reexported_a as e;
35+
pub use crate::foo::reexported_b as f;
36+
pub use crate::foo::reexported_c as g;
37+
pub use crate::foo::reexported_d as h;
38+
pub use crate::foo::reexported_e as i;
3939
}
4040

4141
pub static a: isize = 0;

tests/ui/dep-graph/dep-graph-assoc-type-codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub trait Foo: Sized {
1515
}
1616

1717
mod x {
18-
use Foo;
18+
use crate::Foo;
1919

2020
#[rustc_if_this_changed]
2121
impl Foo for char { type T = char; }
@@ -24,7 +24,7 @@ mod x {
2424
}
2525

2626
mod y {
27-
use Foo;
27+
use crate::Foo;
2828

2929
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
3030
pub fn use_char_assoc() {

0 commit comments

Comments
 (0)