diff options
| author | Lukas Wirth <lukas.wirth@ferrous-systems.com> | 2025-06-03 10:03:42 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukas.wirth@ferrous-systems.com> | 2025-06-03 13:35:31 +0200 |
| commit | eae7fe1bdb5ca2fa3c37c84c5e93d5fb3cbeab8d (patch) | |
| tree | 49a56410279d75fe97d74400d6a7f409f281a6f9 /tests/ui/pub | |
| parent | b17dba45186c454576d0fc8fb93ecc65eb1a763a (diff) | |
| download | rust-eae7fe1bdb5ca2fa3c37c84c5e93d5fb3cbeab8d.tar.gz rust-eae7fe1bdb5ca2fa3c37c84c5e93d5fb3cbeab8d.zip | |
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
Diffstat (limited to 'tests/ui/pub')
| -rw-r--r-- | tests/ui/pub/pub-reexport-priv-extern-crate.rs | 4 | ||||
| -rw-r--r-- | tests/ui/pub/pub-reexport-priv-extern-crate.stderr | 12 | ||||
| -rw-r--r-- | tests/ui/pub/pub-restricted.rs | 6 | ||||
| -rw-r--r-- | tests/ui/pub/pub-restricted.stderr | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/tests/ui/pub/pub-reexport-priv-extern-crate.rs b/tests/ui/pub/pub-reexport-priv-extern-crate.rs index fb495be4001..9d615be30f4 100644 --- a/tests/ui/pub/pub-reexport-priv-extern-crate.rs +++ b/tests/ui/pub/pub-reexport-priv-extern-crate.rs @@ -7,14 +7,14 @@ mod foo1 { } mod foo2 { - use foo1::core; //~ ERROR crate import `core` is private + use crate::foo1::core; //~ ERROR crate import `core` is private pub mod bar { extern crate core; } } mod baz { - pub use foo2::bar::core; //~ ERROR crate import `core` is private + pub use crate::foo2::bar::core; //~ ERROR crate import `core` is private } fn main() {} diff --git a/tests/ui/pub/pub-reexport-priv-extern-crate.stderr b/tests/ui/pub/pub-reexport-priv-extern-crate.stderr index 8ab6e83641d..9bb64a3325b 100644 --- a/tests/ui/pub/pub-reexport-priv-extern-crate.stderr +++ b/tests/ui/pub/pub-reexport-priv-extern-crate.stderr @@ -1,8 +1,8 @@ error[E0603]: crate import `core` is private - --> $DIR/pub-reexport-priv-extern-crate.rs:10:15 + --> $DIR/pub-reexport-priv-extern-crate.rs:10:22 | -LL | use foo1::core; - | ^^^^ private crate import +LL | use crate::foo1::core; + | ^^^^ private crate import | note: the crate import `core` is defined here --> $DIR/pub-reexport-priv-extern-crate.rs:6:5 @@ -11,10 +11,10 @@ LL | extern crate core; | ^^^^^^^^^^^^^^^^^^ error[E0603]: crate import `core` is private - --> $DIR/pub-reexport-priv-extern-crate.rs:17:24 + --> $DIR/pub-reexport-priv-extern-crate.rs:17:31 | -LL | pub use foo2::bar::core; - | ^^^^ private crate import +LL | pub use crate::foo2::bar::core; + | ^^^^ private crate import | note: the crate import `core` is defined here --> $DIR/pub-reexport-priv-extern-crate.rs:12:9 diff --git a/tests/ui/pub/pub-restricted.rs b/tests/ui/pub/pub-restricted.rs index 2aa24121335..4d5eda69de5 100644 --- a/tests/ui/pub/pub-restricted.rs +++ b/tests/ui/pub/pub-restricted.rs @@ -7,7 +7,7 @@ pub (crate::a) fn cfn() {} //~ ERROR incorrect visibility restriction pub fn privfn() {} mod x { mod y { - pub (in x) fn foo() {} + pub (in crate::x) fn foo() {} pub (super) fn bar() {} pub (crate) fn qux() {} } @@ -18,9 +18,9 @@ mod y { pub (crate) c: usize, pub (super) s: usize, valid_private: usize, - pub (in y) valid_in_x: usize, + pub (in crate::y) valid_in_x: usize, pub (a) invalid: usize, //~ ERROR incorrect visibility restriction - pub (in x) non_parent_invalid: usize, //~ ERROR visibilities can only be restricted + pub (in crate::x) non_parent_invalid: usize, //~ ERROR visibilities can only be restricted } } diff --git a/tests/ui/pub/pub-restricted.stderr b/tests/ui/pub/pub-restricted.stderr index 6c913938bb8..0548116362b 100644 --- a/tests/ui/pub/pub-restricted.stderr +++ b/tests/ui/pub/pub-restricted.stderr @@ -76,8 +76,8 @@ LL | pub (in xyz) fn xyz() {} error[E0742]: visibilities can only be restricted to ancestor modules --> $DIR/pub-restricted.rs:23:17 | -LL | pub (in x) non_parent_invalid: usize, - | ^ +LL | pub (in crate::x) non_parent_invalid: usize, + | ^^^^^^^^ error: aborting due to 6 previous errors |
