Skip to content

Commit add4bde

Browse files
authored
Rollup merge of #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() {

tests/ui/dep-graph/dep-graph-caller-callee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod x {
1515
}
1616

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

2020
// These dependencies SHOULD exist:
2121
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
@@ -25,7 +25,7 @@ mod y {
2525
}
2626

2727
mod z {
28-
use y;
28+
use crate::y;
2929

3030
// These are expected to yield errors, because changes to `x`
3131
// affect the BODY of `y`, but not its signature.

tests/ui/dep-graph/dep-graph-struct-signature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct WontChange {
2323

2424
// these are valid dependencies
2525
mod signatures {
26-
use WillChange;
26+
use crate::WillChange;
2727

2828
#[rustc_then_this_would_need(type_of)] //~ ERROR no path
2929
#[rustc_then_this_would_need(associated_item)] //~ ERROR no path
@@ -70,7 +70,7 @@ mod signatures {
7070
}
7171

7272
mod invalid_signatures {
73-
use WontChange;
73+
use crate::WontChange;
7474

7575
#[rustc_then_this_would_need(type_of)] //~ ERROR no path
7676
trait A {

tests/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub trait Bar: Sized {
1919
}
2020

2121
mod x {
22-
use {Foo, Bar};
22+
use crate::{Foo, Bar};
2323

2424
#[rustc_if_this_changed]
2525
impl Foo for u32 { }
@@ -28,7 +28,7 @@ mod x {
2828
}
2929

3030
mod y {
31-
use {Foo, Bar};
31+
use crate::{Foo, Bar};
3232

3333
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
3434
pub fn with_char() {
@@ -37,7 +37,7 @@ mod y {
3737
}
3838

3939
mod z {
40-
use y;
40+
use crate::y;
4141

4242
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
4343
pub fn z() {

tests/ui/dep-graph/dep-graph-trait-impl-two-traits.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub trait Bar: Sized {
1818
}
1919

2020
mod x {
21-
use {Foo, Bar};
21+
use crate::{Foo, Bar};
2222

2323
#[rustc_if_this_changed]
2424
impl Foo for char { }
@@ -27,7 +27,7 @@ mod x {
2727
}
2828

2929
mod y {
30-
use {Foo, Bar};
30+
use crate::{Foo, Bar};
3131

3232
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
3333
pub fn call_bar() {
@@ -36,7 +36,7 @@ mod y {
3636
}
3737

3838
mod z {
39-
use y;
39+
use crate::y;
4040

4141
#[rustc_then_this_would_need(typeck)] //~ ERROR no path
4242
pub fn z() {

tests/ui/dep-graph/dep-graph-trait-impl.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub trait Foo: Sized {
1414
}
1515

1616
mod x {
17-
use Foo;
17+
use crate::Foo;
1818

1919
#[rustc_if_this_changed]
2020
impl Foo for char { }
@@ -23,7 +23,7 @@ mod x {
2323
}
2424

2525
mod y {
26-
use Foo;
26+
use crate::Foo;
2727

2828
#[rustc_then_this_would_need(typeck)] //~ ERROR OK
2929
pub fn with_char() {
@@ -49,7 +49,7 @@ mod y {
4949
}
5050

5151
mod z {
52-
use y;
52+
use crate::y;
5353

5454
// These are expected to yield errors, because changes to `x`
5555
// affect the BODY of `y`, but not its signature.

tests/ui/derived-errors/issue-31997.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn closure<F, T>(x: F) -> Result<T, ()>
1111
}
1212

1313
fn foo() -> Result<(), ()> {
14-
try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope
14+
closure(|| bar(core::ptr::null_mut()))?; //~ ERROR cannot find function `bar` in this scope
1515
Ok(())
1616
}
1717

tests/ui/derived-errors/issue-31997.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0425]: cannot find function `bar` in this scope
2-
--> $DIR/issue-31997.rs:14:21
2+
--> $DIR/issue-31997.rs:14:16
33
|
4-
LL | try!(closure(|| bar(core::ptr::null_mut())));
5-
| ^^^ not found in this scope
4+
LL | closure(|| bar(core::ptr::null_mut()))?;
5+
| ^^^ not found in this scope
66

77
error: aborting due to 1 previous error
88

tests/ui/drop/issue-23338-ensure-param-drop-order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub mod d {
163163
};
164164
self.log.borrow_mut().push(self.uid);
165165
indent_println(self.trail, &format!("+-- Drop {}", self));
166-
indent_println(::PREF_INDENT, "");
166+
indent_println(super::PREF_INDENT, "");
167167
}
168168
}
169169
}

tests/ui/drop/issue-23611-enum-swap-in-drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ pub mod d {
256256
};
257257
self.log.borrow_mut().push(self.uid);
258258
indent_println(self.trail, &format!("+-- Drop {}", self));
259-
indent_println(::PREF_INDENT, "");
259+
indent_println(super::PREF_INDENT, "");
260260
}
261261
}
262262
}

tests/ui/dropck/dropck_trait_cycle_checked.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod s {
1717
}
1818

1919
mod id {
20-
use s;
20+
use crate::s;
2121
#[derive(Debug)]
2222
pub struct Id {
2323
orig_count: usize,

tests/ui/error-codes/E0659.rs

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

99
mod collider {
10-
pub use moon::*;
11-
pub use earth::*;
10+
pub use crate::moon::*;
11+
pub use crate::earth::*;
1212
}
1313

1414
fn main() {

tests/ui/error-codes/E0659.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ LL | collider::foo();
88
note: `foo` could refer to the function imported here
99
--> $DIR/E0659.rs:10:13
1010
|
11-
LL | pub use moon::*;
12-
| ^^^^^^^
11+
LL | pub use crate::moon::*;
12+
| ^^^^^^^^^^^^^^
1313
= help: consider adding an explicit import of `foo` to disambiguate
1414
note: `foo` could also refer to the function imported here
1515
--> $DIR/E0659.rs:11:13
1616
|
17-
LL | pub use earth::*;
18-
| ^^^^^^^^
17+
LL | pub use crate::earth::*;
18+
| ^^^^^^^^^^^^^^^
1919
= help: consider adding an explicit import of `foo` to disambiguate
2020

2121
error: aborting due to 1 previous error

0 commit comments

Comments
 (0)