diff --git a/tests/ui/auxiliary/typeid-intrinsic-aux1.rs b/tests/ui/auxiliary/typeid-intrinsic-aux1.rs index 281c079682fdb..a028008c6ae41 100644 --- a/tests/ui/auxiliary/typeid-intrinsic-aux1.rs +++ b/tests/ui/auxiliary/typeid-intrinsic-aux1.rs @@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>); pub type F = Option; pub type G = usize; pub type H = &'static str; -pub type I = Box; -pub type I32Iterator = Iterator; -pub type U32Iterator = Iterator; +pub type I = Box; +pub type I32Iterator = dyn Iterator; +pub type U32Iterator = dyn Iterator; pub fn id_A() -> TypeId { TypeId::of::() } pub fn id_B() -> TypeId { TypeId::of::() } diff --git a/tests/ui/auxiliary/typeid-intrinsic-aux2.rs b/tests/ui/auxiliary/typeid-intrinsic-aux2.rs index 281c079682fdb..a028008c6ae41 100644 --- a/tests/ui/auxiliary/typeid-intrinsic-aux2.rs +++ b/tests/ui/auxiliary/typeid-intrinsic-aux2.rs @@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>); pub type F = Option; pub type G = usize; pub type H = &'static str; -pub type I = Box; -pub type I32Iterator = Iterator; -pub type U32Iterator = Iterator; +pub type I = Box; +pub type I32Iterator = dyn Iterator; +pub type U32Iterator = dyn Iterator; pub fn id_A() -> TypeId { TypeId::of::() } pub fn id_B() -> TypeId { TypeId::of::() } diff --git a/tests/ui/resolve/auxiliary/issue-80079.rs b/tests/ui/resolve/auxiliary/issue-80079.rs index 190ca75aba86a..bfae5c5a24eef 100644 --- a/tests/ui/resolve/auxiliary/issue-80079.rs +++ b/tests/ui/resolve/auxiliary/issue-80079.rs @@ -1,7 +1,7 @@ #![crate_type = "lib"] pub mod public { - use private_import; + use crate::private_import; // should not be suggested since it is private struct Foo; diff --git a/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs b/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs index 6d0bc728524ba..ac157a82e1799 100644 --- a/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs +++ b/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs @@ -2,7 +2,7 @@ pub mod m { pub struct S(u8); pub mod n { - pub(in m) struct Z(pub(in m::n) u8); + pub(in crate::m) struct Z(pub(in crate::m::n) u8); } } diff --git a/tests/ui/resolve/extern-prelude-fail.rs b/tests/ui/resolve/extern-prelude-fail.rs index c0716f1ebf566..7d0df03e57bbd 100644 --- a/tests/ui/resolve/extern-prelude-fail.rs +++ b/tests/ui/resolve/extern-prelude-fail.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ compile-flags:--extern extern_prelude //@ aux-build:extern-prelude.rs diff --git a/tests/ui/resolve/extern-prelude-fail.stderr b/tests/ui/resolve/extern-prelude-fail.stderr index 199a31244c067..b9668154f4469 100644 --- a/tests/ui/resolve/extern-prelude-fail.stderr +++ b/tests/ui/resolve/extern-prelude-fail.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `extern_prelude` - --> $DIR/extern-prelude-fail.rs:7:9 + --> $DIR/extern-prelude-fail.rs:8:9 | LL | use extern_prelude::S; | ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude` @@ -10,7 +10,7 @@ LL + extern crate extern_prelude; | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `extern_prelude` - --> $DIR/extern-prelude-fail.rs:8:15 + --> $DIR/extern-prelude-fail.rs:9:15 | LL | let s = ::extern_prelude::S; | ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude` diff --git a/tests/ui/resolve/issue-42944.rs b/tests/ui/resolve/issue-42944.rs index 7e439c10b7b84..24aa110329b27 100644 --- a/tests/ui/resolve/issue-42944.rs +++ b/tests/ui/resolve/issue-42944.rs @@ -3,7 +3,7 @@ mod foo { } mod bar { - use foo::Bx; + use crate::foo::Bx; fn foo() { Bx(()); diff --git a/tests/ui/resolve/issue-5035.rs b/tests/ui/resolve/issue-5035.rs index 82c4bc0d5ef9e..a9e2509dde999 100644 --- a/tests/ui/resolve/issue-5035.rs +++ b/tests/ui/resolve/issue-5035.rs @@ -4,7 +4,7 @@ trait I {} type K = dyn I; impl K for isize {} //~ ERROR expected trait, found type alias `K` -use ImportError; //~ ERROR unresolved import `ImportError` [E0432] +use crate::ImportError; //~ ERROR unresolved import `crate::ImportError` [E0432] //~^ NOTE no `ImportError` in the root impl ImportError for () {} // check that this is not an additional error (cf. issue #35142) diff --git a/tests/ui/resolve/issue-5035.stderr b/tests/ui/resolve/issue-5035.stderr index f5717438fc8c9..b26c962c9bb0e 100644 --- a/tests/ui/resolve/issue-5035.stderr +++ b/tests/ui/resolve/issue-5035.stderr @@ -1,8 +1,8 @@ -error[E0432]: unresolved import `ImportError` +error[E0432]: unresolved import `crate::ImportError` --> $DIR/issue-5035.rs:7:5 | -LL | use ImportError; - | ^^^^^^^^^^^ no `ImportError` in the root +LL | use crate::ImportError; + | ^^^^^^^^^^^^^^^^^^ no `ImportError` in the root error[E0404]: expected trait, found type alias `K` --> $DIR/issue-5035.rs:5:6 diff --git a/tests/ui/resolve/privacy-enum-ctor.rs b/tests/ui/resolve/privacy-enum-ctor.rs index f0d2cf8c04e90..3f79b12a267b8 100644 --- a/tests/ui/resolve/privacy-enum-ctor.rs +++ b/tests/ui/resolve/privacy-enum-ctor.rs @@ -8,7 +8,7 @@ mod m { } pub mod n { - pub(in m) enum Z { + pub(in crate::m) enum Z { Fn(u8), Struct { s: u8, @@ -17,7 +17,7 @@ mod m { } } - use m::n::Z; // OK, only the type is imported + use crate::m::n::Z; // OK, only the type is imported fn f() { n::Z; diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr index f349b9391d15a..4ec1b6b97bd32 100644 --- a/tests/ui/resolve/privacy-enum-ctor.stderr +++ b/tests/ui/resolve/privacy-enum-ctor.stderr @@ -7,7 +7,7 @@ LL | n::Z; note: the enum is defined here --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | / pub(in m) enum Z { +LL | / pub(in crate::m) enum Z { LL | | Fn(u8), LL | | Struct { LL | | s: u8, @@ -35,7 +35,7 @@ LL | Z; note: the enum is defined here --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | / pub(in m) enum Z { +LL | / pub(in crate::m) enum Z { LL | | Fn(u8), LL | | Struct { LL | | s: u8, @@ -154,8 +154,8 @@ LL | let _: Z = m::n::Z; note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0423]: expected value, found enum `m::n::Z` --> $DIR/privacy-enum-ctor.rs:57:16 @@ -166,7 +166,7 @@ LL | let _: Z = m::n::Z; note: the enum is defined here --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | / pub(in m) enum Z { +LL | / pub(in crate::m) enum Z { LL | | Fn(u8), LL | | Struct { LL | | s: u8, @@ -197,8 +197,8 @@ LL | let _: Z = m::n::Z::Fn; note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:64:12 @@ -212,8 +212,8 @@ LL | let _: Z = m::n::Z::Struct; note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:68:12 @@ -227,8 +227,8 @@ LL | let _: Z = m::n::Z::Unit {}; note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:57:22 @@ -239,8 +239,8 @@ LL | let _: Z = m::n::Z; note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:61:22 @@ -253,8 +253,8 @@ LL | let _: Z = m::n::Z::Fn; note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:64:22 @@ -265,8 +265,8 @@ LL | let _: Z = m::n::Z::Struct; note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:68:22 @@ -279,8 +279,8 @@ LL | let _: Z = m::n::Z::Unit {}; note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ +LL | pub(in crate::m) enum Z { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/privacy-enum-ctor.rs:27:20 diff --git a/tests/ui/resolve/privacy-struct-ctor.rs b/tests/ui/resolve/privacy-struct-ctor.rs index da0e9f2fc0468..70c751999b7d4 100644 --- a/tests/ui/resolve/privacy-struct-ctor.rs +++ b/tests/ui/resolve/privacy-struct-ctor.rs @@ -9,10 +9,10 @@ mod m { } pub mod n { - pub(in m) struct Z(pub(in m::n) u8); + pub(in crate::m) struct Z(pub(in crate::m::n) u8); } - use m::n::Z; // OK, only the type is imported + use crate::m::n::Z; // OK, only the type is imported fn f() { n::Z; diff --git a/tests/ui/resolve/privacy-struct-ctor.stderr b/tests/ui/resolve/privacy-struct-ctor.stderr index 1d8c741c964e1..0a6b1b46afae7 100644 --- a/tests/ui/resolve/privacy-struct-ctor.stderr +++ b/tests/ui/resolve/privacy-struct-ctor.stderr @@ -42,8 +42,8 @@ LL | pub struct S(u8); error[E0603]: tuple struct constructor `Z` is private --> $DIR/privacy-struct-ctor.rs:18:12 | -LL | pub(in m) struct Z(pub(in m::n) u8); - | --------------- a constructor is private if any of the fields is private +LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); + | ---------------------- a constructor is private if any of the fields is private ... LL | n::Z; | ^ private tuple struct constructor @@ -51,12 +51,12 @@ LL | n::Z; note: the tuple struct constructor `Z` is defined here --> $DIR/privacy-struct-ctor.rs:12:9 | -LL | pub(in m) struct Z(pub(in m::n) u8); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the field publicly accessible | -LL - pub(in m) struct Z(pub(in m::n) u8); -LL + pub(in m) struct Z(pub u8); +LL - pub(in crate::m) struct Z(pub(in crate::m::n) u8); +LL + pub(in crate::m) struct Z(pub u8); | error[E0603]: tuple struct constructor `S` is private @@ -100,8 +100,8 @@ LL | pub struct S(pub u8); error[E0603]: tuple struct constructor `Z` is private --> $DIR/privacy-struct-ctor.rs:35:11 | -LL | pub(in m) struct Z(pub(in m::n) u8); - | --------------- a constructor is private if any of the fields is private +LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); + | ---------------------- a constructor is private if any of the fields is private ... LL | m::n::Z; | ^ private tuple struct constructor @@ -109,12 +109,12 @@ LL | m::n::Z; note: the tuple struct constructor `Z` is defined here --> $DIR/privacy-struct-ctor.rs:12:9 | -LL | pub(in m) struct Z(pub(in m::n) u8); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider making the field publicly accessible | -LL - pub(in m) struct Z(pub(in m::n) u8); -LL + pub(in m) struct Z(pub u8); +LL - pub(in crate::m) struct Z(pub(in crate::m::n) u8); +LL + pub(in crate::m) struct Z(pub u8); | error[E0603]: tuple struct constructor `S` is private @@ -140,16 +140,16 @@ error[E0603]: tuple struct constructor `Z` is private LL | xcrate::m::n::Z; | ^ private tuple struct constructor | - ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28 + ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:35 | -LL | pub(in m) struct Z(pub(in m::n) u8); - | --------------- a constructor is private if any of the fields is private +LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); + | ---------------------- a constructor is private if any of the fields is private | note: the tuple struct constructor `Z` is defined here --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9 | -LL | pub(in m) struct Z(pub(in m::n) u8); - | ^^^^^^^^^^^^^^^^^^ +LL | pub(in crate::m) struct Z(pub(in crate::m::n) u8); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 10 previous errors diff --git a/tests/ui/resolve/resolve-bad-visibility.rs b/tests/ui/resolve/resolve-bad-visibility.rs index 7d48bb97b106e..81635611fca93 100644 --- a/tests/ui/resolve/resolve-bad-visibility.rs +++ b/tests/ui/resolve/resolve-bad-visibility.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 enum E {} trait Tr {} diff --git a/tests/ui/resolve/resolve-bad-visibility.stderr b/tests/ui/resolve/resolve-bad-visibility.stderr index ac7e1c735b1f9..c7bbdfbd24952 100644 --- a/tests/ui/resolve/resolve-bad-visibility.stderr +++ b/tests/ui/resolve/resolve-bad-visibility.stderr @@ -1,23 +1,23 @@ error[E0577]: expected module, found enum `E` - --> $DIR/resolve-bad-visibility.rs:4:8 + --> $DIR/resolve-bad-visibility.rs:5:8 | LL | pub(in E) struct S; | ^ not a module error[E0577]: expected module, found trait `Tr` - --> $DIR/resolve-bad-visibility.rs:5:8 + --> $DIR/resolve-bad-visibility.rs:6:8 | LL | pub(in Tr) struct Z; | ^^ not a module error[E0742]: visibilities can only be restricted to ancestor modules - --> $DIR/resolve-bad-visibility.rs:6:8 + --> $DIR/resolve-bad-visibility.rs:7:8 | LL | pub(in std::vec) struct F; | ^^^^^^^^ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` - --> $DIR/resolve-bad-visibility.rs:7:8 + --> $DIR/resolve-bad-visibility.rs:8:8 | LL | pub(in nonexistent) struct G; | ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent` @@ -28,7 +28,7 @@ LL + extern crate nonexistent; | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `too_soon` - --> $DIR/resolve-bad-visibility.rs:8:8 + --> $DIR/resolve-bad-visibility.rs:9:8 | LL | pub(in too_soon) struct H; | ^^^^^^^^ use of unresolved module or unlinked crate `too_soon` diff --git a/tests/ui/resolve/suggest-builder-fn.rs b/tests/ui/resolve/suggest-builder-fn.rs index 0d9b35549a47d..959675ef2c998 100644 --- a/tests/ui/resolve/suggest-builder-fn.rs +++ b/tests/ui/resolve/suggest-builder-fn.rs @@ -32,7 +32,7 @@ impl Bar { } mod SomeMod { - use Bar; + use crate::Bar; impl Bar { // Public method. Should be suggested diff --git a/tests/ui/resolve/unresolved-segments-visibility.rs b/tests/ui/resolve/unresolved-segments-visibility.rs index c26171f75d2ca..fc86b31adfc25 100644 --- a/tests/ui/resolve/unresolved-segments-visibility.rs +++ b/tests/ui/resolve/unresolved-segments-visibility.rs @@ -5,7 +5,7 @@ extern crate alloc as b; mod foo { mod bar { - pub(in b::string::String::newy) extern crate alloc as e; + pub(in crate::b::string::String::newy) extern crate alloc as e; //~^ ERROR failed to resolve: `String` is a struct, not a module [E0433] } } diff --git a/tests/ui/resolve/unresolved-segments-visibility.stderr b/tests/ui/resolve/unresolved-segments-visibility.stderr index 09f3c50258d93..082579c9fa113 100644 --- a/tests/ui/resolve/unresolved-segments-visibility.stderr +++ b/tests/ui/resolve/unresolved-segments-visibility.stderr @@ -1,8 +1,8 @@ error[E0433]: failed to resolve: `String` is a struct, not a module - --> $DIR/unresolved-segments-visibility.rs:8:27 + --> $DIR/unresolved-segments-visibility.rs:8:34 | -LL | pub(in b::string::String::newy) extern crate alloc as e; - | ^^^^^^ `String` is a struct, not a module +LL | pub(in crate::b::string::String::newy) extern crate alloc as e; + | ^^^^^^ `String` is a struct, not a module error: aborting due to 1 previous error diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed index fbe415e2e10cb..d685c4944baf1 100644 --- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed +++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs index 72a212453cdb5..7a5ecf2720a5b 100644 --- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs +++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr index 036b9ccab4f3b..c0a322edcd647 100644 --- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr +++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-fully-qualified-paths.rs:18:25 + --> $DIR/edition-lint-fully-qualified-paths.rs:19:25 | LL | let _: ::Bar = (); | ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo` @@ -7,13 +7,13 @@ LL | let _: ::Bar = (); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #53130 note: the lint level is defined here - --> $DIR/edition-lint-fully-qualified-paths.rs:3:9 + --> $DIR/edition-lint-fully-qualified-paths.rs:4:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-fully-qualified-paths.rs:18:25 + --> $DIR/edition-lint-fully-qualified-paths.rs:19:25 | LL | let _: ::Bar = (); | ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo` @@ -23,7 +23,7 @@ LL | let _: ::Bar = (); = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-fully-qualified-paths.rs:24:13 + --> $DIR/edition-lint-fully-qualified-paths.rs:25:13 | LL | let _: <::foo::Baz as foo::Foo>::Bar = (); | ^^^^^^^^^^ help: use `crate`: `crate::foo::Baz` diff --git a/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed b/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed index 7ec421099c7ab..4a584a55e6483 100644 --- a/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed +++ b/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs b/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs index 135908c8aef97..2baafbd9704e3 100644 --- a/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs +++ b/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr b/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr index 4174c2fa9adf2..041572be84411 100644 --- a/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr +++ b/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-empty-paths.rs:16:5 + --> $DIR/edition-lint-nested-empty-paths.rs:17:5 | LL | use foo::{bar::{baz::{}}}; | ^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}}}` @@ -7,13 +7,13 @@ LL | use foo::{bar::{baz::{}}}; = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #53130 note: the lint level is defined here - --> $DIR/edition-lint-nested-empty-paths.rs:3:9 + --> $DIR/edition-lint-nested-empty-paths.rs:4:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-empty-paths.rs:20:5 + --> $DIR/edition-lint-nested-empty-paths.rs:21:5 | LL | use foo::{bar::{XX, baz::{}}}; | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{XX, baz::{}}}` @@ -22,7 +22,7 @@ LL | use foo::{bar::{XX, baz::{}}}; = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-empty-paths.rs:20:5 + --> $DIR/edition-lint-nested-empty-paths.rs:21:5 | LL | use foo::{bar::{XX, baz::{}}}; | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{XX, baz::{}}}` @@ -32,7 +32,7 @@ LL | use foo::{bar::{XX, baz::{}}}; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-empty-paths.rs:26:5 + --> $DIR/edition-lint-nested-empty-paths.rs:27:5 | LL | use foo::{bar::{baz::{}, baz1::{}}}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}, baz1::{}}}` @@ -41,7 +41,7 @@ LL | use foo::{bar::{baz::{}, baz1::{}}}; = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-empty-paths.rs:26:5 + --> $DIR/edition-lint-nested-empty-paths.rs:27:5 | LL | use foo::{bar::{baz::{}, baz1::{}}}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}, baz1::{}}}` diff --git a/tests/ui/rust-2018/edition-lint-nested-paths.fixed b/tests/ui/rust-2018/edition-lint-nested-paths.fixed index 93ccb2fe6af22..bf0038c3be451 100644 --- a/tests/ui/rust-2018/edition-lint-nested-paths.fixed +++ b/tests/ui/rust-2018/edition-lint-nested-paths.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-nested-paths.rs b/tests/ui/rust-2018/edition-lint-nested-paths.rs index 1c1d21dbab911..87dc51a3745e9 100644 --- a/tests/ui/rust-2018/edition-lint-nested-paths.rs +++ b/tests/ui/rust-2018/edition-lint-nested-paths.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![deny(absolute_paths_not_starting_with_crate)] diff --git a/tests/ui/rust-2018/edition-lint-nested-paths.stderr b/tests/ui/rust-2018/edition-lint-nested-paths.stderr index d059a2533a903..4a70bb7e5c875 100644 --- a/tests/ui/rust-2018/edition-lint-nested-paths.stderr +++ b/tests/ui/rust-2018/edition-lint-nested-paths.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-paths.rs:5:5 + --> $DIR/edition-lint-nested-paths.rs:6:5 | LL | use foo::{a, b}; | ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}` @@ -7,13 +7,13 @@ LL | use foo::{a, b}; = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #53130 note: the lint level is defined here - --> $DIR/edition-lint-nested-paths.rs:3:9 + --> $DIR/edition-lint-nested-paths.rs:4:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-paths.rs:5:5 + --> $DIR/edition-lint-nested-paths.rs:6:5 | LL | use foo::{a, b}; | ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}` @@ -23,7 +23,7 @@ LL | use foo::{a, b}; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-paths.rs:22:13 + --> $DIR/edition-lint-nested-paths.rs:23:13 | LL | use foo::{self as x, c}; | ^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self as x, c}` @@ -32,7 +32,7 @@ LL | use foo::{self as x, c}; = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-nested-paths.rs:22:13 + --> $DIR/edition-lint-nested-paths.rs:23:13 | LL | use foo::{self as x, c}; | ^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self as x, c}` diff --git a/tests/ui/rust-2018/edition-lint-paths.fixed b/tests/ui/rust-2018/edition-lint-paths.fixed index 014bf91886f7a..9664b461161ad 100644 --- a/tests/ui/rust-2018/edition-lint-paths.fixed +++ b/tests/ui/rust-2018/edition-lint-paths.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix diff --git a/tests/ui/rust-2018/edition-lint-paths.rs b/tests/ui/rust-2018/edition-lint-paths.rs index 0ecd090c1dffe..39cdad3ab98b2 100644 --- a/tests/ui/rust-2018/edition-lint-paths.rs +++ b/tests/ui/rust-2018/edition-lint-paths.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix diff --git a/tests/ui/rust-2018/edition-lint-paths.stderr b/tests/ui/rust-2018/edition-lint-paths.stderr index 553a3bfdaa8c7..fde17338d98a7 100644 --- a/tests/ui/rust-2018/edition-lint-paths.stderr +++ b/tests/ui/rust-2018/edition-lint-paths.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:11:9 + --> $DIR/edition-lint-paths.rs:12:9 | LL | use bar::Bar; | ^^^^^^^^ help: use `crate`: `crate::bar::Bar` @@ -7,13 +7,13 @@ LL | use bar::Bar; = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #53130 note: the lint level is defined here - --> $DIR/edition-lint-paths.rs:4:9 + --> $DIR/edition-lint-paths.rs:5:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:18:9 + --> $DIR/edition-lint-paths.rs:19:9 | LL | use bar; | ^^^ help: use `crate`: `crate::bar` @@ -22,7 +22,7 @@ LL | use bar; = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:24:9 + --> $DIR/edition-lint-paths.rs:25:9 | LL | use {main, Bar as SomethingElse}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}` @@ -31,7 +31,7 @@ LL | use {main, Bar as SomethingElse}; = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:24:9 + --> $DIR/edition-lint-paths.rs:25:9 | LL | use {main, Bar as SomethingElse}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}` @@ -41,7 +41,7 @@ LL | use {main, Bar as SomethingElse}; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:24:9 + --> $DIR/edition-lint-paths.rs:25:9 | LL | use {main, Bar as SomethingElse}; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}` @@ -51,7 +51,7 @@ LL | use {main, Bar as SomethingElse}; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:39:5 + --> $DIR/edition-lint-paths.rs:40:5 | LL | use bar::Bar; | ^^^^^^^^ help: use `crate`: `crate::bar::Bar` @@ -60,7 +60,7 @@ LL | use bar::Bar; = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:51:9 + --> $DIR/edition-lint-paths.rs:52:9 | LL | use *; | ^ help: use `crate`: `crate::*` @@ -69,7 +69,7 @@ LL | use *; = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:56:6 + --> $DIR/edition-lint-paths.rs:57:6 | LL | impl ::foo::SomeTrait for u32 {} | ^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::SomeTrait` @@ -78,7 +78,7 @@ LL | impl ::foo::SomeTrait for u32 {} = note: for more information, see issue #53130 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/edition-lint-paths.rs:61:13 + --> $DIR/edition-lint-paths.rs:62:13 | LL | let x = ::bar::Bar; | ^^^^^^^^^^ help: use `crate`: `crate::bar::Bar` diff --git a/tests/ui/rust-2018/extern-crate-rename.fixed b/tests/ui/rust-2018/extern-crate-rename.fixed index 36b5280299038..b6b665f537e36 100644 --- a/tests/ui/rust-2018/extern-crate-rename.fixed +++ b/tests/ui/rust-2018/extern-crate-rename.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix diff --git a/tests/ui/rust-2018/extern-crate-rename.rs b/tests/ui/rust-2018/extern-crate-rename.rs index 725e3aaa0726c..3257ab876e1ee 100644 --- a/tests/ui/rust-2018/extern-crate-rename.rs +++ b/tests/ui/rust-2018/extern-crate-rename.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix diff --git a/tests/ui/rust-2018/extern-crate-rename.stderr b/tests/ui/rust-2018/extern-crate-rename.stderr index 6b2512080309c..36986c89c62bc 100644 --- a/tests/ui/rust-2018/extern-crate-rename.stderr +++ b/tests/ui/rust-2018/extern-crate-rename.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/extern-crate-rename.rs:11:5 + --> $DIR/extern-crate-rename.rs:12:5 | LL | use my_crate::foo; | ^^^^^^^^^^^^^ help: use `crate`: `crate::my_crate::foo` @@ -7,7 +7,7 @@ LL | use my_crate::foo; = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #53130 note: the lint level is defined here - --> $DIR/extern-crate-rename.rs:7:9 + --> $DIR/extern-crate-rename.rs:8:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2018/extern-crate-submod.fixed b/tests/ui/rust-2018/extern-crate-submod.fixed index dc864d8703923..8657960e9725e 100644 --- a/tests/ui/rust-2018/extern-crate-submod.fixed +++ b/tests/ui/rust-2018/extern-crate-submod.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix diff --git a/tests/ui/rust-2018/extern-crate-submod.rs b/tests/ui/rust-2018/extern-crate-submod.rs index f15bc6bced8c8..bf0a38d2b34ef 100644 --- a/tests/ui/rust-2018/extern-crate-submod.rs +++ b/tests/ui/rust-2018/extern-crate-submod.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ aux-build:edition-lint-paths.rs //@ run-rustfix diff --git a/tests/ui/rust-2018/extern-crate-submod.stderr b/tests/ui/rust-2018/extern-crate-submod.stderr index 0d45d32d568b2..85e26d72a673b 100644 --- a/tests/ui/rust-2018/extern-crate-submod.stderr +++ b/tests/ui/rust-2018/extern-crate-submod.stderr @@ -1,5 +1,5 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition - --> $DIR/extern-crate-submod.rs:18:5 + --> $DIR/extern-crate-submod.rs:19:5 | LL | use m::edition_lint_paths::foo; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::m::edition_lint_paths::foo` @@ -7,7 +7,7 @@ LL | use m::edition_lint_paths::foo; = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #53130 note: the lint level is defined here - --> $DIR/extern-crate-submod.rs:8:9 + --> $DIR/extern-crate-submod.rs:9:9 | LL | #![deny(absolute_paths_not_starting_with_crate)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rust-2018/try-ident.fixed b/tests/ui/rust-2018/try-ident.fixed index b1c446e10226f..b514c6d075654 100644 --- a/tests/ui/rust-2018/try-ident.fixed +++ b/tests/ui/rust-2018/try-ident.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix //@ check-pass diff --git a/tests/ui/rust-2018/try-ident.rs b/tests/ui/rust-2018/try-ident.rs index 8e62f698e2528..2b8bb9234e559 100644 --- a/tests/ui/rust-2018/try-ident.rs +++ b/tests/ui/rust-2018/try-ident.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix //@ check-pass diff --git a/tests/ui/rust-2018/try-ident.stderr b/tests/ui/rust-2018/try-ident.stderr index eaf4c235697c7..aca623d7d4829 100644 --- a/tests/ui/rust-2018/try-ident.stderr +++ b/tests/ui/rust-2018/try-ident.stderr @@ -1,5 +1,5 @@ warning: `try` is a keyword in the 2018 edition - --> $DIR/try-ident.rs:7:5 + --> $DIR/try-ident.rs:8:5 | LL | try(); | ^^^ help: you can use a raw identifier to stay compatible: `r#try` @@ -7,14 +7,14 @@ LL | try(); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #49716 note: the lint level is defined here - --> $DIR/try-ident.rs:4:9 + --> $DIR/try-ident.rs:5:9 | LL | #![warn(rust_2018_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[warn(keyword_idents_2018)]` implied by `#[warn(rust_2018_compatibility)]` warning: `try` is a keyword in the 2018 edition - --> $DIR/try-ident.rs:12:4 + --> $DIR/try-ident.rs:13:4 | LL | fn try() { | ^^^ help: you can use a raw identifier to stay compatible: `r#try` diff --git a/tests/ui/rust-2018/try-macro.fixed b/tests/ui/rust-2018/try-macro.fixed index 98c48d6b96f67..f2d8cf2bd9a5f 100644 --- a/tests/ui/rust-2018/try-macro.fixed +++ b/tests/ui/rust-2018/try-macro.fixed @@ -1,5 +1,6 @@ // Test that `try!` macros are rewritten. +//@ edition: 2015 //@ run-rustfix //@ check-pass diff --git a/tests/ui/rust-2018/try-macro.rs b/tests/ui/rust-2018/try-macro.rs index 99480b2a3ec1b..fec8eaa1786b3 100644 --- a/tests/ui/rust-2018/try-macro.rs +++ b/tests/ui/rust-2018/try-macro.rs @@ -1,5 +1,6 @@ // Test that `try!` macros are rewritten. +//@ edition: 2015 //@ run-rustfix //@ check-pass diff --git a/tests/ui/rust-2018/try-macro.stderr b/tests/ui/rust-2018/try-macro.stderr index 095c755539db4..20105e1868f2e 100644 --- a/tests/ui/rust-2018/try-macro.stderr +++ b/tests/ui/rust-2018/try-macro.stderr @@ -1,5 +1,5 @@ warning: `try` is a keyword in the 2018 edition - --> $DIR/try-macro.rs:12:5 + --> $DIR/try-macro.rs:13:5 | LL | try!(x); | ^^^ help: you can use a raw identifier to stay compatible: `r#try` @@ -7,7 +7,7 @@ LL | try!(x); = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! = note: for more information, see issue #49716 note: the lint level is defined here - --> $DIR/try-macro.rs:6:9 + --> $DIR/try-macro.rs:7:9 | LL | #![warn(rust_2018_compatibility)] | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/self/self-shadowing-import.rs b/tests/ui/self/self-shadowing-import.rs index 85574daad5fd5..78d04e0713aa2 100644 --- a/tests/ui/self/self-shadowing-import.rs +++ b/tests/ui/self/self-shadowing-import.rs @@ -9,7 +9,7 @@ mod a { } mod c { - use a::b::a; + use crate::a::b::a; pub fn bar() { assert_eq!(a::foo(), 1); } } diff --git a/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs b/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs index 59efb3f790b8c..a0d91c5dc87c5 100644 --- a/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs +++ b/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs @@ -13,8 +13,8 @@ pub mod b { } pub mod c { - use a::one; - use b::two; + use crate::a::one; + use crate::b::two; pub fn three() -> usize { one() + two() } diff --git a/tests/ui/sepcomp/sepcomp-extern.rs b/tests/ui/sepcomp/sepcomp-extern.rs index 6acd3a1eede33..d0756c5f19a7d 100644 --- a/tests/ui/sepcomp/sepcomp-extern.rs +++ b/tests/ui/sepcomp/sepcomp-extern.rs @@ -16,13 +16,13 @@ fn call1() -> usize { mod a { pub fn call2() -> usize { - unsafe { ::foo() } + unsafe { crate::foo() } } } mod b { pub fn call3() -> usize { - unsafe { ::foo() } + unsafe { crate::foo() } } } diff --git a/tests/ui/sepcomp/sepcomp-fns-backwards.rs b/tests/ui/sepcomp/sepcomp-fns-backwards.rs index 35326d19d6e30..c671771babb29 100644 --- a/tests/ui/sepcomp/sepcomp-fns-backwards.rs +++ b/tests/ui/sepcomp/sepcomp-fns-backwards.rs @@ -12,13 +12,13 @@ fn pad() -> usize { 0 } mod b { pub fn three() -> usize { - ::one() + ::a::two() + crate::one() + crate::a::two() } } mod a { pub fn two() -> usize { - ::one() + ::one() + crate::one() + crate::one() } } diff --git a/tests/ui/sepcomp/sepcomp-fns.rs b/tests/ui/sepcomp/sepcomp-fns.rs index 399193e69b655..1486a2471b851 100644 --- a/tests/ui/sepcomp/sepcomp-fns.rs +++ b/tests/ui/sepcomp/sepcomp-fns.rs @@ -13,13 +13,13 @@ fn one() -> usize { 1 } mod a { pub fn two() -> usize { - ::one() + ::one() + crate::one() + crate::one() } } mod b { pub fn three() -> usize { - ::one() + ::a::two() + crate::one() + crate::a::two() } } diff --git a/tests/ui/sepcomp/sepcomp-statics.rs b/tests/ui/sepcomp/sepcomp-statics.rs index 580bb628da68c..3fe897f3c30bf 100644 --- a/tests/ui/sepcomp/sepcomp-statics.rs +++ b/tests/ui/sepcomp/sepcomp-statics.rs @@ -15,13 +15,13 @@ mod b { // that `a` and `b` don't go into the same compilation unit. fn pad() -> usize { 0 } - pub static THREE: usize = ::ONE + ::a::TWO; + pub static THREE: usize = crate::ONE + crate::a::TWO; } mod a { fn pad() -> usize { 0 } - pub const TWO: usize = ::ONE + ::ONE; + pub const TWO: usize = crate::ONE + crate::ONE; } fn main() { diff --git a/tests/ui/sepcomp/sepcomp-unwind.rs b/tests/ui/sepcomp/sepcomp-unwind.rs index 8c25278bb7ec6..95591676b5eed 100644 --- a/tests/ui/sepcomp/sepcomp-unwind.rs +++ b/tests/ui/sepcomp/sepcomp-unwind.rs @@ -26,10 +26,10 @@ mod a { mod b { pub fn g() { - ::a::f(); + crate::a::f(); } } fn main() { - thread::spawn(move|| { ::b::g() }).join().unwrap_err(); + thread::spawn(move|| { b::g() }).join().unwrap_err(); } diff --git a/tests/ui/shadowed-use-visibility.rs b/tests/ui/shadowed-use-visibility.rs index 66181267f98a8..5ce4103b55970 100644 --- a/tests/ui/shadowed-use-visibility.rs +++ b/tests/ui/shadowed-use-visibility.rs @@ -5,7 +5,7 @@ mod foo { pub fn f() {} pub use self::f as bar; - use foo as bar; + use crate::foo as bar; } fn main() { diff --git a/tests/ui/shadowed/shadowed-trait-methods.rs b/tests/ui/shadowed/shadowed-trait-methods.rs index f9c25d9791314..6cc5159fd0896 100644 --- a/tests/ui/shadowed/shadowed-trait-methods.rs +++ b/tests/ui/shadowed/shadowed-trait-methods.rs @@ -5,7 +5,7 @@ mod foo { impl T for () {} } -mod bar { pub use foo::T; } +mod bar { pub use crate::foo::T; } fn main() { pub use bar::*; diff --git a/tests/ui/shadowed/shadowed-use-visibility.rs b/tests/ui/shadowed/shadowed-use-visibility.rs index 6b801972f4179..070aeaf146700 100644 --- a/tests/ui/shadowed/shadowed-use-visibility.rs +++ b/tests/ui/shadowed/shadowed-use-visibility.rs @@ -1,15 +1,15 @@ mod foo { pub fn f() {} - use foo as bar; + use crate::foo as bar; pub use self::f as bar; } mod bar { - use foo::bar::f as g; //~ ERROR module import `bar` is private + use crate::foo::bar::f as g; //~ ERROR module import `bar` is private - use foo as f; - pub use foo::*; + use crate::foo as f; + pub use crate::foo::*; } use bar::f::f; //~ ERROR module import `f` is private diff --git a/tests/ui/shadowed/shadowed-use-visibility.stderr b/tests/ui/shadowed/shadowed-use-visibility.stderr index 1a642ae6e8ed8..b062341dc8be8 100644 --- a/tests/ui/shadowed/shadowed-use-visibility.stderr +++ b/tests/ui/shadowed/shadowed-use-visibility.stderr @@ -1,14 +1,14 @@ error[E0603]: module import `bar` is private - --> $DIR/shadowed-use-visibility.rs:9:14 + --> $DIR/shadowed-use-visibility.rs:9:21 | -LL | use foo::bar::f as g; - | ^^^ private module import +LL | use crate::foo::bar::f as g; + | ^^^ private module import | note: the module import `bar` is defined here... --> $DIR/shadowed-use-visibility.rs:4:9 | -LL | use foo as bar; - | ^^^^^^^^^^ +LL | use crate::foo as bar; + | ^^^^^^^^^^^^^^^^^ note: ...and refers to the module `foo` which is defined here --> $DIR/shadowed-use-visibility.rs:1:1 | @@ -24,8 +24,8 @@ LL | use bar::f::f; note: the module import `f` is defined here... --> $DIR/shadowed-use-visibility.rs:11:9 | -LL | use foo as f; - | ^^^^^^^^ +LL | use crate::foo as f; + | ^^^^^^^^^^^^^^^ note: ...and refers to the module `foo` which is defined here --> $DIR/shadowed-use-visibility.rs:1:1 | diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs index 66a432be35737..baa664d593394 100644 --- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs +++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs @@ -1,3 +1,5 @@ +//@ edition: 2015 + #![warn(rust_2021_incompatible_closure_captures)] fn main() {} diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr index 5ecbedf186785..00b9a81b27d99 100644 --- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr +++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr @@ -1,5 +1,5 @@ error[E0670]: `async fn` is not permitted in Rust 2015 - --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:8:16 + --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:10:16 | LL | pub(crate) async fn new( | ^^^^^ to use `async fn`, switch to Rust 2018 or later @@ -8,7 +8,7 @@ LL | pub(crate) async fn new( = note: for more on editions, read https://doc.rust-lang.org/edition-guide error[E0412]: cannot find type `Duration` in this scope - --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:10:19 + --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:12:19 | LL | interval: Duration, | ^^^^^^^^ not found in this scope diff --git a/tests/ui/span/dropck_arr_cycle_checked.rs b/tests/ui/span/dropck_arr_cycle_checked.rs index a14db5ff08966..adecb3f59424c 100644 --- a/tests/ui/span/dropck_arr_cycle_checked.rs +++ b/tests/ui/span/dropck_arr_cycle_checked.rs @@ -19,7 +19,7 @@ mod s { } mod id { - use s; + use crate::s; #[derive(Debug)] pub struct Id { orig_count: usize, diff --git a/tests/ui/span/dropck_vec_cycle_checked.rs b/tests/ui/span/dropck_vec_cycle_checked.rs index c5d21507d76ce..b015131caf163 100644 --- a/tests/ui/span/dropck_vec_cycle_checked.rs +++ b/tests/ui/span/dropck_vec_cycle_checked.rs @@ -16,7 +16,7 @@ mod s { } mod id { - use s; + use crate::s; #[derive(Debug)] pub struct Id { orig_count: usize, diff --git a/tests/ui/span/vec-must-not-hide-type-from-dropck.rs b/tests/ui/span/vec-must-not-hide-type-from-dropck.rs index 9bfbfab06a0ac..972ffef2e3c86 100644 --- a/tests/ui/span/vec-must-not-hide-type-from-dropck.rs +++ b/tests/ui/span/vec-must-not-hide-type-from-dropck.rs @@ -31,7 +31,7 @@ mod s { } mod id { - use s; + use crate::s; /// Id represents a globally unique identifier (global across the /// current process, that is). When dropped, it automatically diff --git a/tests/ui/span/visibility-ty-params.rs b/tests/ui/span/visibility-ty-params.rs index 11c2cf44cb459..05d93e5463604 100644 --- a/tests/ui/span/visibility-ty-params.rs +++ b/tests/ui/span/visibility-ty-params.rs @@ -3,11 +3,11 @@ macro_rules! m { } struct S(T); -m!{ S } //~ ERROR unexpected generic arguments in path - //~| ERROR failed to resolve: `S` is a struct, not a module [E0433] +m!{ crate::S } //~ ERROR unexpected generic arguments in path + //~| ERROR failed to resolve: `S` is a struct, not a module [E0433] mod m { - m!{ m<> } //~ ERROR unexpected generic arguments in path + m!{ crate::m<> } //~ ERROR unexpected generic arguments in path } fn main() {} diff --git a/tests/ui/span/visibility-ty-params.stderr b/tests/ui/span/visibility-ty-params.stderr index 97d05c4644e82..7b02d79a1bc21 100644 --- a/tests/ui/span/visibility-ty-params.stderr +++ b/tests/ui/span/visibility-ty-params.stderr @@ -1,20 +1,20 @@ error: unexpected generic arguments in path - --> $DIR/visibility-ty-params.rs:6:6 + --> $DIR/visibility-ty-params.rs:6:13 | -LL | m!{ S } - | ^^^^ +LL | m!{ crate::S } + | ^^^^ error[E0433]: failed to resolve: `S` is a struct, not a module - --> $DIR/visibility-ty-params.rs:6:5 + --> $DIR/visibility-ty-params.rs:6:12 | -LL | m!{ S } - | ^ `S` is a struct, not a module +LL | m!{ crate::S } + | ^ `S` is a struct, not a module error: unexpected generic arguments in path - --> $DIR/visibility-ty-params.rs:10:10 + --> $DIR/visibility-ty-params.rs:10:17 | -LL | m!{ m<> } - | ^^ +LL | m!{ crate::m<> } + | ^^ error: aborting due to 3 previous errors diff --git a/tests/ui/static/auxiliary/static_priv_by_default.rs b/tests/ui/static/auxiliary/static_priv_by_default.rs index 39f912066ece9..fe9aef42feb21 100644 --- a/tests/ui/static/auxiliary/static_priv_by_default.rs +++ b/tests/ui/static/auxiliary/static_priv_by_default.rs @@ -31,11 +31,11 @@ mod foo { } pub mod bar { - pub use foo::reexported_a as e; - pub use foo::reexported_b as f; - pub use foo::reexported_c as g; - pub use foo::reexported_d as h; - pub use foo::reexported_e as i; + pub use crate::foo::reexported_a as e; + pub use crate::foo::reexported_b as f; + pub use crate::foo::reexported_c as g; + pub use crate::foo::reexported_d as h; + pub use crate::foo::reexported_e as i; } pub static a: isize = 0; diff --git a/tests/ui/static/static-extern-type.rs b/tests/ui/static/static-extern-type.rs index 8b022a5c31c37..2597c22ed7e80 100644 --- a/tests/ui/static/static-extern-type.rs +++ b/tests/ui/static/static-extern-type.rs @@ -10,7 +10,7 @@ pub mod a { pub mod b { #[repr(transparent)] - pub struct TransparentType(::a::StartFn); + pub struct TransparentType(crate::a::StartFn); extern "C" { pub static start: TransparentType; } @@ -18,7 +18,7 @@ pub mod b { pub mod c { #[repr(C)] - pub struct CType(u32, ::b::TransparentType); + pub struct CType(u32, crate::b::TransparentType); extern "C" { pub static start: CType; } diff --git a/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs b/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs index 8d0f7f61ced19..a739e8f2dbe6f 100644 --- a/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs +++ b/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs @@ -5,7 +5,7 @@ pub mod num { } pub mod f64 { - impl ::num::Num2 for f64 { + impl crate::num::Num2 for f64 { #[inline] fn from_int2(n: isize) -> f64 { return n as f64; } } diff --git a/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs b/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs index b8aed2c5f54d9..ab73bac3bf810 100644 --- a/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs +++ b/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs @@ -5,7 +5,7 @@ pub mod num { } pub mod f64 { - impl ::num::Num2 for f64 { + impl crate::num::Num2 for f64 { fn from_int2(n: isize) -> f64 { return n as f64; } } } diff --git a/tests/ui/statics/static-impl.rs b/tests/ui/statics/static-impl.rs index 37f3cd1313335..5c8d20da0c685 100644 --- a/tests/ui/statics/static-impl.rs +++ b/tests/ui/statics/static-impl.rs @@ -9,12 +9,12 @@ pub trait plus { } mod a { - use plus; + use crate::plus; impl plus for usize { fn plus(&self) -> isize { *self as isize + 20 } } } mod b { - use plus; + use crate::plus; impl plus for String { fn plus(&self) -> isize { 200 } } } diff --git a/tests/ui/structs-enums/issue-2718-a.rs b/tests/ui/structs-enums/issue-2718-a.rs index 6c49158454058..f799a82447fe5 100644 --- a/tests/ui/structs-enums/issue-2718-a.rs +++ b/tests/ui/structs-enums/issue-2718-a.rs @@ -3,7 +3,7 @@ pub struct SendPacket { } mod pingpong { - use SendPacket; + use crate::SendPacket; pub type Ping = SendPacket; pub struct Pong(SendPacket); //~^ ERROR recursive type `Pong` has infinite size diff --git a/tests/ui/structs-enums/namespaced-enum-glob-import.rs b/tests/ui/structs-enums/namespaced-enum-glob-import.rs index e8a709d5bd0c0..82742a934c413 100644 --- a/tests/ui/structs-enums/namespaced-enum-glob-import.rs +++ b/tests/ui/structs-enums/namespaced-enum-glob-import.rs @@ -14,7 +14,7 @@ mod m2 { } mod m { - pub use m2::Foo::*; + pub use crate::m2::Foo::*; } fn _f(f: m2::Foo) { diff --git a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs index 2893bbc8b7139..63fe5ebaea499 100644 --- a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs +++ b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs @@ -1,16 +1,15 @@ -#![allow(bare_trait_objects)] trait A: Sized { - fn f(a: A) -> A; + fn f(a: dyn A) -> dyn A; //~^ ERROR associated item referring to unboxed trait object for its own trait //~| ERROR the trait `A` is not dyn compatible } trait B { - fn f(a: B) -> B; + fn f(a: dyn B) -> dyn B; //~^ ERROR associated item referring to unboxed trait object for its own trait //~| ERROR the trait `B` is not dyn compatible } trait C { - fn f(&self, a: C) -> C; + fn f(&self, a: dyn C) -> dyn C; } fn main() {} diff --git a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr index f4b669d7fcd41..e8384afed7a11 100644 --- a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr +++ b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr @@ -1,26 +1,26 @@ error: associated item referring to unboxed trait object for its own trait - --> $DIR/dyn-incompatible-trait-should-use-self.rs:3:13 + --> $DIR/dyn-incompatible-trait-should-use-self.rs:2:13 | LL | trait A: Sized { | - in this trait -LL | fn f(a: A) -> A; - | ^ ^ +LL | fn f(a: dyn A) -> dyn A; + | ^^^^^ ^^^^^ | help: you might have meant to use `Self` to refer to the implementing type | -LL - fn f(a: A) -> A; +LL - fn f(a: dyn A) -> dyn A; LL + fn f(a: Self) -> Self; | error[E0038]: the trait `A` is not dyn compatible - --> $DIR/dyn-incompatible-trait-should-use-self.rs:3:13 + --> $DIR/dyn-incompatible-trait-should-use-self.rs:2:13 | -LL | fn f(a: A) -> A; - | ^ `A` is not dyn compatible +LL | fn f(a: dyn A) -> dyn A; + | ^^^^^ `A` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/dyn-incompatible-trait-should-use-self.rs:2:10 + --> $DIR/dyn-incompatible-trait-should-use-self.rs:1:10 | LL | trait A: Sized { | - ^^^^^ ...because it requires `Self: Sized` @@ -28,41 +28,41 @@ LL | trait A: Sized { | this trait is not dyn compatible... error: associated item referring to unboxed trait object for its own trait - --> $DIR/dyn-incompatible-trait-should-use-self.rs:8:13 + --> $DIR/dyn-incompatible-trait-should-use-self.rs:7:13 | LL | trait B { | - in this trait -LL | fn f(a: B) -> B; - | ^ ^ +LL | fn f(a: dyn B) -> dyn B; + | ^^^^^ ^^^^^ | help: you might have meant to use `Self` to refer to the implementing type | -LL - fn f(a: B) -> B; +LL - fn f(a: dyn B) -> dyn B; LL + fn f(a: Self) -> Self; | error[E0038]: the trait `B` is not dyn compatible - --> $DIR/dyn-incompatible-trait-should-use-self.rs:8:13 + --> $DIR/dyn-incompatible-trait-should-use-self.rs:7:13 | -LL | fn f(a: B) -> B; - | ^ `B` is not dyn compatible +LL | fn f(a: dyn B) -> dyn B; + | ^^^^^ `B` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/dyn-incompatible-trait-should-use-self.rs:8:8 + --> $DIR/dyn-incompatible-trait-should-use-self.rs:7:8 | LL | trait B { | - this trait is not dyn compatible... -LL | fn f(a: B) -> B; +LL | fn f(a: dyn B) -> dyn B; | ^ ...because associated function `f` has no `self` parameter help: consider turning `f` into a method by giving it a `&self` argument | -LL | fn f(&self, a: B) -> B; +LL | fn f(&self, a: dyn B) -> dyn B; | ++++++ help: alternatively, consider constraining `f` so it does not apply to trait objects | -LL | fn f(a: B) -> B where Self: Sized; - | +++++++++++++++++ +LL | fn f(a: dyn B) -> dyn B where Self: Sized; + | +++++++++++++++++ error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs index efa296db47cf9..d10b3bec543ef 100644 --- a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs +++ b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs @@ -1,4 +1,5 @@ // Regression test for ICE #125876 +//@ edition: 2015 fn main() { std::ptr::from_ref(num).cast_mut().as_deref(); diff --git a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr index f943688e6578b..696151b6ee2c0 100644 --- a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr +++ b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr @@ -1,11 +1,11 @@ error[E0425]: cannot find value `num` in this scope - --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:24 + --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:24 | LL | std::ptr::from_ref(num).cast_mut().as_deref(); | ^^^ not found in this scope warning: type annotations needed - --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:29 + --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:29 | LL | std::ptr::from_ref(num).cast_mut().as_deref(); | ^^^^^^^^ @@ -15,7 +15,7 @@ LL | std::ptr::from_ref(num).cast_mut().as_deref(); = note: `#[warn(tyvar_behind_raw_pointer)]` on by default warning: type annotations needed - --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:40 + --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:40 | LL | std::ptr::from_ref(num).cast_mut().as_deref(); | ^^^^^^^^ @@ -24,7 +24,7 @@ LL | std::ptr::from_ref(num).cast_mut().as_deref(); = note: for more information, see issue #46906 error[E0599]: no method named `as_deref` found for raw pointer `*mut _` in the current scope - --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:40 + --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:40 | LL | std::ptr::from_ref(num).cast_mut().as_deref(); | ^^^^^^^^ diff --git a/tests/ui/suggestions/issue-116434-2015.rs b/tests/ui/suggestions/issue-116434-2015.rs index 1518765152ff8..bad9d02321cf2 100644 --- a/tests/ui/suggestions/issue-116434-2015.rs +++ b/tests/ui/suggestions/issue-116434-2015.rs @@ -1,3 +1,5 @@ +//@ edition: 2015 + trait Foo { type Clone; fn foo() -> Clone; diff --git a/tests/ui/suggestions/issue-116434-2015.stderr b/tests/ui/suggestions/issue-116434-2015.stderr index 07a254432a28d..a0a99cc560dba 100644 --- a/tests/ui/suggestions/issue-116434-2015.stderr +++ b/tests/ui/suggestions/issue-116434-2015.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-116434-2015.rs:3:17 + --> $DIR/issue-116434-2015.rs:5:17 | LL | fn foo() -> Clone; | ^^^^^ @@ -13,7 +13,7 @@ LL | fn foo() -> dyn Clone; | +++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-116434-2015.rs:3:17 + --> $DIR/issue-116434-2015.rs:5:17 | LL | fn foo() -> Clone; | ^^^^^ @@ -27,7 +27,7 @@ LL | fn foo() -> dyn Clone; | +++ error[E0038]: the trait `Clone` is not dyn compatible - --> $DIR/issue-116434-2015.rs:3:17 + --> $DIR/issue-116434-2015.rs:5:17 | LL | fn foo() -> Clone; | ^^^^^ `Clone` is not dyn compatible @@ -41,7 +41,7 @@ LL | fn foo() -> Self::Clone; | ++++++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-116434-2015.rs:18:20 + --> $DIR/issue-116434-2015.rs:20:20 | LL | fn handle() -> DbHandle; | ^^^^^^^^ @@ -54,7 +54,7 @@ LL | fn handle() -> dyn DbHandle; | +++ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-116434-2015.rs:18:20 + --> $DIR/issue-116434-2015.rs:20:20 | LL | fn handle() -> DbHandle; | ^^^^^^^^ @@ -68,14 +68,14 @@ LL | fn handle() -> dyn DbHandle; | +++ error[E0038]: the trait `DbHandle` is not dyn compatible - --> $DIR/issue-116434-2015.rs:18:20 + --> $DIR/issue-116434-2015.rs:20:20 | LL | fn handle() -> DbHandle; | ^^^^^^^^ `DbHandle` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/issue-116434-2015.rs:14:17 + --> $DIR/issue-116434-2015.rs:16:17 | LL | trait DbHandle: Sized {} | -------- ^^^^^ ...because it requires `Self: Sized` diff --git a/tests/ui/suggestions/issue-61963.rs b/tests/ui/suggestions/issue-61963.rs index 2fafe629db97e..77e4b21f5dbd5 100644 --- a/tests/ui/suggestions/issue-61963.rs +++ b/tests/ui/suggestions/issue-61963.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ proc-macro: issue-61963.rs //@ proc-macro: issue-61963-1.rs #![deny(bare_trait_objects)] diff --git a/tests/ui/suggestions/issue-61963.stderr b/tests/ui/suggestions/issue-61963.stderr index 734c88f3fd675..ef11efe5c74d7 100644 --- a/tests/ui/suggestions/issue-61963.stderr +++ b/tests/ui/suggestions/issue-61963.stderr @@ -1,5 +1,5 @@ error: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-61963.rs:22:14 + --> $DIR/issue-61963.rs:23:14 | LL | bar: Box, | ^^^ @@ -7,7 +7,7 @@ LL | bar: Box, = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see note: the lint level is defined here - --> $DIR/issue-61963.rs:3:9 + --> $DIR/issue-61963.rs:4:9 | LL | #![deny(bare_trait_objects)] | ^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | bar: Box, | +++ error: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-61963.rs:18:1 + --> $DIR/issue-61963.rs:19:1 | LL | pub struct Foo { | ^^^ diff --git a/tests/ui/suggestions/missing-lifetime-specifier.rs b/tests/ui/suggestions/missing-lifetime-specifier.rs index a957477897d54..88d9736a071de 100644 --- a/tests/ui/suggestions/missing-lifetime-specifier.rs +++ b/tests/ui/suggestions/missing-lifetime-specifier.rs @@ -7,7 +7,6 @@ // Different number of duplicated diagnostics on different targets //@ compile-flags: -Zdeduplicate-diagnostics=yes -#![allow(bare_trait_objects)] use std::cell::RefCell; use std::collections::HashMap; @@ -28,7 +27,7 @@ thread_local! { //~^ ERROR missing lifetime specifiers } thread_local! { - static b: RefCell>>> = RefCell::new(HashMap::new()); + static b: RefCell>>> = RefCell::new(HashMap::new()); //~^ ERROR missing lifetime specifiers } thread_local! { @@ -36,7 +35,7 @@ thread_local! { //~^ ERROR missing lifetime specifiers } thread_local! { - static d: RefCell>>>> = RefCell::new(HashMap::new()); + static d: RefCell>>>> = RefCell::new(HashMap::new()); //~^ ERROR missing lifetime specifiers } @@ -45,8 +44,9 @@ thread_local! { //~^ ERROR union takes 2 lifetime arguments but 1 lifetime argument } thread_local! { - static f: RefCell>>>> = RefCell::new(HashMap::new()); - //~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied + static f: RefCell>>>> = + RefCell::new(HashMap::new()); + //~^^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied //~| ERROR missing lifetime specifier } diff --git a/tests/ui/suggestions/missing-lifetime-specifier.stderr b/tests/ui/suggestions/missing-lifetime-specifier.stderr index 1fdbf3b0c79af..b8c58155e636d 100644 --- a/tests/ui/suggestions/missing-lifetime-specifier.stderr +++ b/tests/ui/suggestions/missing-lifetime-specifier.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:27:44 + --> $DIR/missing-lifetime-specifier.rs:26:44 | LL | static a: RefCell>>> = RefCell::new(HashMap::new()); | ^^^ expected 2 lifetime parameters @@ -11,21 +11,21 @@ LL | static a: RefCell>>>> = RefC | ++++++++++++++++++ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:31:44 + --> $DIR/missing-lifetime-specifier.rs:30:44 | -LL | static b: RefCell>>> = RefCell::new(HashMap::new()); - | ^^^^ expected 2 lifetime parameters +LL | static b: RefCell>>> = RefCell::new(HashMap::new()); + | ^ ^^^ expected 2 lifetime parameters | | | expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | -LL | static b: RefCell>>>> = RefCell::new(HashMap::new()); - | +++++++ ++++++++++++++++++ +LL | static b: RefCell>>>> = RefCell::new(HashMap::new()); + | +++++++ ++++++++++++++++++ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:35:47 + --> $DIR/missing-lifetime-specifier.rs:34:47 | LL | static c: RefCell>>>> = RefCell::new(HashMap::new()); | ^ expected 2 lifetime parameters @@ -37,33 +37,38 @@ LL | static c: RefCell>>>> = | +++++++++++++++++ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:39:44 + --> $DIR/missing-lifetime-specifier.rs:38:44 | -LL | static d: RefCell>>>> = RefCell::new(HashMap::new()); - | ^ ^ expected 2 lifetime parameters +LL | static d: RefCell>>>> = RefCell::new(HashMap::new()); + | ^ ^ expected 2 lifetime parameters | | | expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | -LL | static d: RefCell>>>> = RefCell::new(HashMap::new()); - | +++++++ +++++++++++++++++ +LL | static d: RefCell>>>> = RefCell::new(HashMap::new()); + | +++++++ +++++++++++++++++ error[E0106]: missing lifetime specifier - --> $DIR/missing-lifetime-specifier.rs:48:44 + --> $DIR/missing-lifetime-specifier.rs:47:44 | -LL | static f: RefCell>>>> = RefCell::new(HashMap::new()); +LL | static f: RefCell>>>> = | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | -LL | static f: RefCell>>>> = RefCell::new(HashMap::new()); +LL | static f: RefCell>>>> = | +++++++ +help: instead, you are more likely to want to return an owned value + | +LL - static f: RefCell>>>> = +LL + static f: RefCell>>>> = + | error[E0107]: union takes 2 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/missing-lifetime-specifier.rs:44:44 + --> $DIR/missing-lifetime-specifier.rs:43:44 | LL | static e: RefCell>>>> = RefCell::new(HashMap::new()); | ^^^ ------- supplied 1 lifetime argument @@ -71,7 +76,7 @@ LL | static e: RefCell>>>> = RefCell: | expected 2 lifetime arguments | note: union defined here, with 2 lifetime parameters: `'t`, `'k` - --> $DIR/missing-lifetime-specifier.rs:20:11 + --> $DIR/missing-lifetime-specifier.rs:19:11 | LL | pub union Qux<'t, 'k, I> { | ^^^ -- -- @@ -81,22 +86,22 @@ LL | static e: RefCell>>>> = | +++++++++ error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/missing-lifetime-specifier.rs:48:45 + --> $DIR/missing-lifetime-specifier.rs:47:49 | -LL | static f: RefCell>>>> = RefCell::new(HashMap::new()); - | ^^^ ------- supplied 1 lifetime argument - | | - | expected 2 lifetime arguments +LL | static f: RefCell>>>> = + | ^^^ ------- supplied 1 lifetime argument + | | + | expected 2 lifetime arguments | note: trait defined here, with 2 lifetime parameters: `'t`, `'k` - --> $DIR/missing-lifetime-specifier.rs:24:7 + --> $DIR/missing-lifetime-specifier.rs:23:7 | LL | trait Tar<'t, 'k, I> {} | ^^^ -- -- help: add missing lifetime argument | -LL | static f: RefCell>>>> = RefCell::new(HashMap::new()); - | +++++++++ +LL | static f: RefCell>>>> = + | +++++++++ error: aborting due to 7 previous errors diff --git a/tests/ui/symbol-names/impl1.rs b/tests/ui/symbol-names/impl1.rs index 694cd89bd80f0..0fdf564547993 100644 --- a/tests/ui/symbol-names/impl1.rs +++ b/tests/ui/symbol-names/impl1.rs @@ -26,7 +26,7 @@ mod foo { } mod bar { - use foo::Foo; + use crate::foo::Foo; impl Foo { #[rustc_symbol_name] diff --git a/tests/ui/symbol-names/issue-53912.rs b/tests/ui/symbol-names/issue-53912.rs index 194416cdb70c9..ba28316b0bf05 100644 --- a/tests/ui/symbol-names/issue-53912.rs +++ b/tests/ui/symbol-names/issue-53912.rs @@ -12,13 +12,13 @@ mod llvm { mod foo { pub(crate) struct Foo(T); - impl Foo<::llvm::Foo> { + impl Foo { pub(crate) fn foo() { for _ in 0..0 { - for _ in &[::dummy()] { - ::dummy(); - ::dummy(); - ::dummy(); + for _ in &[crate::dummy()] { + crate::dummy(); + crate::dummy(); + crate::dummy(); } } } diff --git a/tests/ui/symbol-names/issue-60925.rs b/tests/ui/symbol-names/issue-60925.rs index ca0f21b7a781d..24969fc664196 100644 --- a/tests/ui/symbol-names/issue-60925.rs +++ b/tests/ui/symbol-names/issue-60925.rs @@ -17,7 +17,7 @@ mod llvm { mod foo { pub(crate) struct Foo(T); - impl Foo<::llvm::Foo> { + impl Foo { #[rustc_symbol_name] //[legacy]~^ ERROR symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo //[legacy]~| ERROR demangling(issue_60925::foo::Foo::foo @@ -27,10 +27,10 @@ mod foo { //[v0]~| ERROR demangling-alt(>::foo) pub(crate) fn foo() { for _ in 0..0 { - for _ in &[::dummy()] { - ::dummy(); - ::dummy(); - ::dummy(); + for _ in &[crate::dummy()] { + crate::dummy(); + crate::dummy(); + crate::dummy(); } } } diff --git a/tests/ui/threads-sendsync/thread-local-syntax.rs b/tests/ui/threads-sendsync/thread-local-syntax.rs index 2cf91f0c1f78d..9492e1c93e259 100644 --- a/tests/ui/threads-sendsync/thread-local-syntax.rs +++ b/tests/ui/threads-sendsync/thread-local-syntax.rs @@ -13,7 +13,7 @@ mod foo { // look at these restrictions!! pub(crate) static BAZ: usize = 0; - pub(in foo) static QUUX: usize = 0; + pub(in crate::foo) static QUUX: usize = 0; } thread_local!(static SPLOK: u32 = 0); } diff --git a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed index e6aac1708cef7..6354676bb25b3 100644 --- a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed +++ b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![allow(non_snake_case)] mod A { diff --git a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs index d5c557dc9c7dc..c3b3a00aa6dd0 100644 --- a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs +++ b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs @@ -1,3 +1,4 @@ +//@ edition: 2015 //@ run-rustfix #![allow(non_snake_case)] mod A { diff --git a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr index e2a72697501f2..4fb0dcc790171 100644 --- a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr +++ b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `Trait` in `A` - --> $DIR/shadowed-path-in-trait-bound-suggestion.rs:9:24 + --> $DIR/shadowed-path-in-trait-bound-suggestion.rs:10:24 | LL | pub struct A(pub H); | ^^^^^ not found in `A` diff --git a/tests/ui/traits/auxiliary/traitimpl.rs b/tests/ui/traits/auxiliary/traitimpl.rs index fda5314cdbfa5..2544a96048b67 100644 --- a/tests/ui/traits/auxiliary/traitimpl.rs +++ b/tests/ui/traits/auxiliary/traitimpl.rs @@ -2,6 +2,6 @@ pub trait Bar<'a> : 'a {} -impl<'a> Bar<'a> { +impl<'a> dyn Bar<'a> { pub fn bar(&self) {} } diff --git a/tests/ui/traits/const-traits/inherent-impl.rs b/tests/ui/traits/const-traits/inherent-impl.rs index afd0d137bb4aa..07b23adf9e1f6 100644 --- a/tests/ui/traits/const-traits/inherent-impl.rs +++ b/tests/ui/traits/const-traits/inherent-impl.rs @@ -7,7 +7,7 @@ trait T {} impl const S {} //~^ ERROR inherent impls cannot be `const` -impl const T {} +impl const dyn T {} //~^ ERROR inherent impls cannot be `const` fn main() {} diff --git a/tests/ui/traits/const-traits/inherent-impl.stderr b/tests/ui/traits/const-traits/inherent-impl.stderr index 8c55627031d1e..e4ec1e807b0e3 100644 --- a/tests/ui/traits/const-traits/inherent-impl.stderr +++ b/tests/ui/traits/const-traits/inherent-impl.stderr @@ -11,8 +11,8 @@ LL | impl const S {} error: inherent impls cannot be `const` --> $DIR/inherent-impl.rs:10:12 | -LL | impl const T {} - | ----- ^ inherent impl for this type +LL | impl const dyn T {} + | ----- ^^^^^ inherent impl for this type | | | `const` because of this | diff --git a/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs b/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs index 9d65a2ac30260..fadfbe667887d 100644 --- a/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs +++ b/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs @@ -1,6 +1,7 @@ // Ensure that the introduction of const trait bound didn't regress this code in Rust 2015. // See also `mbe-const-trait-bound-theoretical-regression.rs`. +//@ edition: 2015 //@ check-pass macro_rules! check { diff --git a/tests/ui/traits/impl-2.rs b/tests/ui/traits/impl-2.rs index c6f60a9081cc4..41fa1cd334f40 100644 --- a/tests/ui/traits/impl-2.rs +++ b/tests/ui/traits/impl-2.rs @@ -10,7 +10,7 @@ pub mod Foo { } mod Bar { - impl<'a> dyn (::Foo::Trait) + 'a { + impl<'a> dyn (crate::Foo::Trait) + 'a { fn bar(&self) { self.foo() } } } diff --git a/tests/ui/traits/item-privacy.rs b/tests/ui/traits/item-privacy.rs index 9f75e6e4c1235..b8724399e327b 100644 --- a/tests/ui/traits/item-privacy.rs +++ b/tests/ui/traits/item-privacy.rs @@ -15,9 +15,9 @@ mod method { fn c(&self) { } } - impl A for ::S {} - impl B for ::S {} - impl C for ::S {} + impl A for crate::S {} + impl B for crate::S {} + impl C for crate::S {} } mod assoc_const { @@ -33,9 +33,9 @@ mod assoc_const { const C: u8 = 0; } - impl A for ::S {} - impl B for ::S {} - impl C for ::S {} + impl A for crate::S {} + impl B for crate::S {} + impl C for crate::S {} } mod assoc_ty { @@ -51,9 +51,9 @@ mod assoc_ty { type C = u8; } - impl A for ::S {} - impl B for ::S {} - impl C for ::S {} + impl A for crate::S {} + impl B for crate::S {} + impl C for crate::S {} } fn check_method() { diff --git a/tests/ui/traits/static-method-overwriting.rs b/tests/ui/traits/static-method-overwriting.rs index 7a2a51a4b9959..28edcde4c4993 100644 --- a/tests/ui/traits/static-method-overwriting.rs +++ b/tests/ui/traits/static-method-overwriting.rs @@ -9,7 +9,7 @@ mod base { dummy: (), } - impl ::base::HasNew for Foo { + impl crate::base::HasNew for Foo { fn new() -> Foo { println!("Foo"); Foo { dummy: () } @@ -20,7 +20,7 @@ mod base { dummy: (), } - impl ::base::HasNew for Bar { + impl crate::base::HasNew for Bar { fn new() -> Bar { println!("Bar"); Bar { dummy: () } diff --git a/tests/ui/tuple/tuple-struct-fields/test.rs b/tests/ui/tuple/tuple-struct-fields/test.rs index 00677090d78c5..29aabf4579b12 100644 --- a/tests/ui/tuple/tuple-struct-fields/test.rs +++ b/tests/ui/tuple/tuple-struct-fields/test.rs @@ -1,6 +1,6 @@ mod foo { type T = (); - struct S1(pub(in foo) (), pub(T), pub(crate) (), pub(((), T))); + struct S1(pub(in crate::foo) (), pub(T), pub(crate) (), pub(((), T))); struct S2(pub((foo)) ()); //~^ ERROR expected one of `)` or `,`, found `(` //~| ERROR cannot find type `foo` in this scope diff --git a/tests/ui/tuple/tuple-struct-fields/test2.rs b/tests/ui/tuple/tuple-struct-fields/test2.rs index 2b2a2c127e985..544d486752c70 100644 --- a/tests/ui/tuple/tuple-struct-fields/test2.rs +++ b/tests/ui/tuple/tuple-struct-fields/test2.rs @@ -1,7 +1,7 @@ macro_rules! define_struct { ($t:ty) => { struct S1(pub $t); - struct S2(pub (in foo) ()); + struct S2(pub (in crate::foo) ()); struct S3(pub $t ()); //~^ ERROR expected one of `)` or `,`, found `(` } diff --git a/tests/ui/tuple/tuple-struct-fields/test3.rs b/tests/ui/tuple/tuple-struct-fields/test3.rs index 98d19426e7733..b5f98a65fa6bf 100644 --- a/tests/ui/tuple/tuple-struct-fields/test3.rs +++ b/tests/ui/tuple/tuple-struct-fields/test3.rs @@ -1,7 +1,7 @@ macro_rules! define_struct { ($t:ty) => { struct S1(pub($t)); - struct S2(pub (in foo) ()); + struct S2(pub (in crate::foo) ()); struct S3(pub($t) ()); //~^ ERROR expected one of `)` or `,`, found `(` } diff --git a/tests/ui/type/auxiliary/crate_a1.rs b/tests/ui/type/auxiliary/crate_a1.rs index 616493193fd6c..f8ee9ae15c179 100644 --- a/tests/ui/type/auxiliary/crate_a1.rs +++ b/tests/ui/type/auxiliary/crate_a1.rs @@ -2,10 +2,10 @@ pub struct Foo; pub trait Bar {} -pub fn bar() -> Box { +pub fn bar() -> Box { unimplemented!() } pub fn try_foo(x: Foo){} -pub fn try_bar(x: Box){} +pub fn try_bar(x: Box){} diff --git a/tests/ui/type/auxiliary/crate_a2.rs b/tests/ui/type/auxiliary/crate_a2.rs index 57a7685b77c4f..fe22598e63e90 100644 --- a/tests/ui/type/auxiliary/crate_a2.rs +++ b/tests/ui/type/auxiliary/crate_a2.rs @@ -2,6 +2,6 @@ pub struct Foo; pub trait Bar {} -pub fn bar() -> Box { +pub fn bar() -> Box { unimplemented!() } diff --git a/tests/ui/type/issue-7607-2.rs b/tests/ui/type/issue-7607-2.rs index ebc4fe1c2d301..53fafdf9489ea 100644 --- a/tests/ui/type/issue-7607-2.rs +++ b/tests/ui/type/issue-7607-2.rs @@ -6,7 +6,7 @@ pub mod a { } pub mod b { - use a::Foo; + use crate::a::Foo; impl Foo { fn bar(&self) { } } diff --git a/tests/ui/type/type-mismatch-same-crate-name.stderr b/tests/ui/type/type-mismatch-same-crate-name.stderr index 7b791549f5632..8fafbfaa93425 100644 --- a/tests/ui/type/type-mismatch-same-crate-name.stderr +++ b/tests/ui/type/type-mismatch-same-crate-name.stderr @@ -59,7 +59,7 @@ LL | extern crate crate_a1 as a; note: function defined here --> $DIR/auxiliary/crate_a1.rs:11:8 | -LL | pub fn try_bar(x: Box){} +LL | pub fn try_bar(x: Box){} | ^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/underscore-imports/basic.rs b/tests/ui/underscore-imports/basic.rs index 624ecb47ca681..8d8ff5c47bc24 100644 --- a/tests/ui/underscore-imports/basic.rs +++ b/tests/ui/underscore-imports/basic.rs @@ -18,25 +18,25 @@ mod m { fn tr2_is_in_scope(&self) {} } - impl Tr1 for ::S {} - impl Tr2 for ::S {} + impl Tr1 for crate::S {} + impl Tr2 for crate::S {} } mod unused { - use m::Tr1 as _; //~ WARN unused import - use S as _; //~ WARN unused import + use crate::m::Tr1 as _; //~ WARN unused import + use crate::S as _; //~ WARN unused import extern crate core as _; // OK } mod outer { mod middle { - pub use m::Tr1 as _; - pub use m::Tr2 as _; // OK, no name conflict + pub use crate::m::Tr1 as _; + pub use crate::m::Tr2 as _; // OK, no name conflict struct Tr1; // OK, no name conflict fn check() { // Both traits are in scope - ::S.tr1_is_in_scope(); - ::S.tr2_is_in_scope(); + crate::S.tr1_is_in_scope(); + crate::S.tr2_is_in_scope(); } mod inner { @@ -44,8 +44,8 @@ mod outer { use super::*; fn check() { // Both traits are in scope - ::S.tr1_is_in_scope(); - ::S.tr2_is_in_scope(); + crate::S.tr1_is_in_scope(); + crate::S.tr2_is_in_scope(); } } } @@ -54,8 +54,8 @@ mod outer { use self::middle::*; fn check() { // Both traits are in scope - ::S.tr1_is_in_scope(); - ::S.tr2_is_in_scope(); + crate::S.tr1_is_in_scope(); + crate::S.tr2_is_in_scope(); } } diff --git a/tests/ui/underscore-imports/basic.stderr b/tests/ui/underscore-imports/basic.stderr index c51493562ebd7..666d07349dfb7 100644 --- a/tests/ui/underscore-imports/basic.stderr +++ b/tests/ui/underscore-imports/basic.stderr @@ -1,8 +1,8 @@ -warning: unused import: `m::Tr1 as _` +warning: unused import: `crate::m::Tr1 as _` --> $DIR/basic.rs:26:9 | -LL | use m::Tr1 as _; - | ^^^^^^^^^^^ +LL | use crate::m::Tr1 as _; + | ^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/basic.rs:4:9 @@ -10,11 +10,11 @@ note: the lint level is defined here LL | #![warn(unused_imports, unused_extern_crates)] | ^^^^^^^^^^^^^^ -warning: unused import: `S as _` +warning: unused import: `crate::S as _` --> $DIR/basic.rs:27:9 | -LL | use S as _; - | ^^^^^^ +LL | use crate::S as _; + | ^^^^^^^^^^^^^ warning: 2 warnings emitted diff --git a/tests/ui/unresolved/unresolved-import-recovery.rs b/tests/ui/unresolved/unresolved-import-recovery.rs index 0b0653378cbbd..8657bb661a87b 100644 --- a/tests/ui/unresolved/unresolved-import-recovery.rs +++ b/tests/ui/unresolved/unresolved-import-recovery.rs @@ -1,7 +1,7 @@ // Check that unresolved imports do not create additional errors and ICEs mod m { - pub use unresolved; //~ ERROR unresolved import `unresolved` + pub use crate::unresolved; //~ ERROR unresolved import `crate::unresolved` fn f() { let unresolved = 0; // OK diff --git a/tests/ui/unresolved/unresolved-import-recovery.stderr b/tests/ui/unresolved/unresolved-import-recovery.stderr index 1c006049756e9..ec41c9e79d747 100644 --- a/tests/ui/unresolved/unresolved-import-recovery.stderr +++ b/tests/ui/unresolved/unresolved-import-recovery.stderr @@ -1,8 +1,8 @@ -error[E0432]: unresolved import `unresolved` +error[E0432]: unresolved import `crate::unresolved` --> $DIR/unresolved-import-recovery.rs:4:13 | -LL | pub use unresolved; - | ^^^^^^^^^^ no `unresolved` in the root +LL | pub use crate::unresolved; + | ^^^^^^^^^^^^^^^^^ no `unresolved` in the root error: aborting due to 1 previous error diff --git a/tests/ui/unsized/unsized3-rpass.rs b/tests/ui/unsized/unsized3-rpass.rs index ff35051774bc6..03aa1a538eadf 100644 --- a/tests/ui/unsized/unsized3-rpass.rs +++ b/tests/ui/unsized/unsized3-rpass.rs @@ -37,7 +37,7 @@ impl Tr for St { } struct Qux<'a> { - f: Tr + 'a, + f: dyn Tr + 'a, } pub fn main() { @@ -85,7 +85,7 @@ pub fn main() { } let obj: Box = Box::new(St { f: 42 }); - let obj: &Tr = &*obj; + let obj: &dyn Tr = &*obj; let data: Box<_> = Box::new(Qux_ { f: St { f: 234 } }); let x: &Qux = &*ptr::from_raw_parts::(&*data as *const _, ptr::metadata(obj)); assert_eq!(x.f.foo(), 234); diff --git a/tests/ui/use/use-mod/use-mod-4.rs b/tests/ui/use/use-mod/use-mod-4.rs index 46ae8ddadc094..34ce7c7195758 100644 --- a/tests/ui/use/use-mod/use-mod-4.rs +++ b/tests/ui/use/use-mod/use-mod-4.rs @@ -1,4 +1,4 @@ -use foo::self; //~ ERROR unresolved import `foo` +use crate::foo::self; //~ ERROR unresolved import `crate::foo` //~^ ERROR `self` imports are only allowed within a { } list use std::mem::self; diff --git a/tests/ui/use/use-mod/use-mod-4.stderr b/tests/ui/use/use-mod/use-mod-4.stderr index 0b4fbadb45829..d4621296c0d18 100644 --- a/tests/ui/use/use-mod/use-mod-4.stderr +++ b/tests/ui/use/use-mod/use-mod-4.stderr @@ -1,18 +1,18 @@ error[E0429]: `self` imports are only allowed within a { } list - --> $DIR/use-mod-4.rs:1:8 + --> $DIR/use-mod-4.rs:1:15 | -LL | use foo::self; - | ^^^^^^ +LL | use crate::foo::self; + | ^^^^^^ | help: consider importing the module directly | -LL - use foo::self; -LL + use foo; +LL - use crate::foo::self; +LL + use crate::foo; | help: alternatively, use the multi-path `use` syntax to import `self` | -LL | use foo::{self}; - | + + +LL | use crate::foo::{self}; + | + + error[E0429]: `self` imports are only allowed within a { } list --> $DIR/use-mod-4.rs:4:13 @@ -30,11 +30,11 @@ help: alternatively, use the multi-path `use` syntax to import `self` LL | use std::mem::{self}; | + + -error[E0432]: unresolved import `foo` +error[E0432]: unresolved import `crate::foo` --> $DIR/use-mod-4.rs:1:5 | -LL | use foo::self; - | ^^^^^^^^^ no `foo` in the root +LL | use crate::foo::self; + | ^^^^^^^^^^^^^^^^ no `foo` in the root error: aborting due to 3 previous errors diff --git a/tests/ui/warnings/no-explicit-path-issue-122509.rs b/tests/ui/warnings/no-explicit-path-issue-122509.rs index 4e8eefde5dad1..5be4b174076db 100644 --- a/tests/ui/warnings/no-explicit-path-issue-122509.rs +++ b/tests/ui/warnings/no-explicit-path-issue-122509.rs @@ -7,13 +7,13 @@ fn one() -> usize { pub mod a { pub fn two() -> usize { - ::one() + ::one() + crate::one() + crate::one() } } pub mod b { pub fn three() -> usize { - ::one() + ::a::two() + crate::one() + crate::a::two() } } diff --git a/tests/ui/weird-exprs.rs b/tests/ui/weird-exprs.rs index b24e754a4ec98..7db92d4606713 100644 --- a/tests/ui/weird-exprs.rs +++ b/tests/ui/weird-exprs.rs @@ -105,7 +105,7 @@ fn u8(u8: u8) { u8!(u8); let &u8: &u8 = u8::u8(&8u8); - ::u8(0u8); + crate::u8(0u8); u8 }); } diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs index a95e10b7265dd..53f07a94fd15e 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs @@ -1,17 +1,11 @@ -trait Trait { +trait Trait { //~^ ERROR cannot find value `bar` in this scope //~| ERROR cycle detected when computing type of `Trait::N` - //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] - //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - fn fnc(&self) -> Trait { + fn fnc(&self) -> dyn Trait { //~^ ERROR the name `N` is already used for a generic parameter in this item's generic parameters //~| ERROR expected value, found builtin type `u32` //~| ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions //~| ERROR associated item referring to unboxed trait object for its own trait - //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] - //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects] - //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! bar //~^ ERROR cannot find value `bar` in this scope } diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr index 59eef0c63278a..a085dd6ac5761 100644 --- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr @@ -1,106 +1,66 @@ error[E0403]: the name `N` is already used for a generic parameter in this item's generic parameters - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:18 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:18 | -LL | trait Trait { +LL | trait Trait { | - first use of `N` ... -LL | fn fnc(&self) -> Trait { +LL | fn fnc(&self) -> dyn Trait { | ^ already used error[E0425]: cannot find value `bar` in this scope - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:30 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:34 | -LL | trait Trait { - | ^^^ not found in this scope +LL | trait Trait { + | ^^^ not found in this scope error[E0423]: expected value, found builtin type `u32` - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:29 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:33 | -LL | fn fnc(&self) -> Trait { - | ^^^ not a value +LL | fn fnc(&self) -> dyn Trait { + | ^^^ not a value error[E0425]: cannot find value `bar` in this scope - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:15:9 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:9:9 | LL | bar | ^^^ not found in this scope -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 - | -LL | trait Trait { - | ^^^^^ - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see - = note: `#[warn(bare_trait_objects)]` on by default -help: if this is a dyn-compatible trait, use `dyn` - | -LL | trait Trait { - | +++ - error[E0391]: cycle detected when computing type of `Trait::N` - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:26 | -LL | trait Trait { - | ^^^^^ +LL | trait Trait { + | ^^^^^ | = note: ...which immediately requires computing type of `Trait::N` again note: cycle used when computing explicit predicates of trait `Trait` --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:1 | -LL | trait Trait { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | trait Trait { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:12 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:12 | -LL | fn fnc(&self) -> Trait { - | ^^^^^^^^^^^^^^^^^^^^ - -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44 - | -LL | fn fnc(&self) -> Trait { - | ^^^^^ - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see -help: if this is a dyn-compatible trait, use `dyn` - | -LL | fn fnc(&self) -> dyn Trait { - | +++ - -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:21 - | -LL | fn fnc(&self) -> Trait { - | ^^^^^ - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see -help: if this is a dyn-compatible trait, use `dyn` - | -LL | fn fnc(&self) -> Trait { - | +++ +LL | fn fnc(&self) -> dyn Trait { + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: associated item referring to unboxed trait object for its own trait - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44 + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:48 | -LL | trait Trait { +LL | trait Trait { | ----- in this trait ... -LL | fn fnc(&self) -> Trait { - | ^^^^^ +LL | fn fnc(&self) -> dyn Trait { + | ^^^^^^^^^ | help: you might have meant to use `Self` to refer to the implementing type | -LL - fn fnc(&self) -> Trait { -LL + fn fnc(&self) -> Self { +LL - fn fnc(&self) -> dyn Trait { +LL + fn fnc(&self) -> Self { | -error: aborting due to 7 previous errors; 3 warnings emitted +error: aborting due to 7 previous errors Some errors have detailed explanations: E0391, E0403, E0423, E0425. For more information about an error, try `rustc --explain E0391`.