diff options
| author | bors <bors@rust-lang.org> | 2018-11-19 02:59:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-11-19 02:59:29 +0000 |
| commit | 7e82eda000c8d4abbdaa76b3563cd77f938fc411 (patch) | |
| tree | b245a1f7b79958535f7d14d14039710e1d3b6991 /src/test | |
| parent | a9b791b3c0543120ed03e70600e6cf4f451b4124 (diff) | |
| parent | 38025e0dca8c2f049884eedc58792c4e321ed27c (diff) | |
| download | rust-7e82eda000c8d4abbdaa76b3563cd77f938fc411.tar.gz rust-7e82eda000c8d4abbdaa76b3563cd77f938fc411.zip | |
Auto merge of #56042 - petrochenkov:nuni, r=petrochenkov
[nightly] resolve: Implement uniform paths 2.0 Forward-port of https://github.com/rust-lang/rust/pull/55884 to nightly. r? @ghost
Diffstat (limited to 'src/test')
171 files changed, 1203 insertions, 613 deletions
diff --git a/src/test/ui-fulldeps/custom-derive/derive-in-mod.rs b/src/test/ui-fulldeps/custom-derive/derive-in-mod.rs new file mode 100644 index 00000000000..8478ff1a6ae --- /dev/null +++ b/src/test/ui-fulldeps/custom-derive/derive-in-mod.rs @@ -0,0 +1,13 @@ +// compile-pass +// aux-build:plugin.rs + +extern crate plugin; + +mod inner { + use plugin::WithHelper; + + #[derive(WithHelper)] + struct S; +} + +fn main() {} diff --git a/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr b/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr index 059629c0b62..ee98873064f 100644 --- a/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr +++ b/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr @@ -1,19 +1,20 @@ -error[E0659]: `helper` is ambiguous +error[E0659]: `helper` is ambiguous (derive helper attribute vs any other name) --> $DIR/helper-attr-blocked-by-import-ambig.rs:10:3 | LL | #[helper] //~ ERROR `helper` is ambiguous | ^^^^^^ ambiguous name | -note: `helper` could refer to the name defined here +note: `helper` could refer to the derive helper attribute defined here --> $DIR/helper-attr-blocked-by-import-ambig.rs:9:10 | LL | #[derive(WithHelper)] | ^^^^^^^^^^ -note: `helper` could also refer to the name imported here +note: `helper` could also refer to the attribute macro imported here --> $DIR/helper-attr-blocked-by-import-ambig.rs:7:5 | LL | use plugin::helper; | ^^^^^^^^^^^^^^ + = help: use `self::helper` to refer to this attribute macro unambiguously error: aborting due to previous error diff --git a/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.stderr b/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.stderr index ea867faf47b..34b21ea2683 100644 --- a/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.stderr +++ b/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.stderr @@ -1,98 +1,78 @@ -error[E0659]: `repr` is ambiguous +error[E0425]: cannot find value `NonExistent` in this scope + --> $DIR/ambiguous-builtin-attrs.rs:30:5 + | +LL | NonExistent; //~ ERROR cannot find value `NonExistent` in this scope + | ^^^^^^^^^^^ not found in this scope + +error[E0659]: `repr` is ambiguous (built-in attribute vs any other name) --> $DIR/ambiguous-builtin-attrs.rs:9:3 | LL | #[repr(C)] //~ ERROR `repr` is ambiguous | ^^^^ ambiguous name | -note: `repr` could refer to the name imported here + = note: `repr` could refer to a built-in attribute +note: `repr` could also refer to the attribute macro imported here --> $DIR/ambiguous-builtin-attrs.rs:7:5 | LL | use builtin_attrs::*; | ^^^^^^^^^^^^^^^^ -note: `repr` could also refer to the name defined here - --> $DIR/ambiguous-builtin-attrs.rs:9:3 - | -LL | #[repr(C)] //~ ERROR `repr` is ambiguous - | ^^^^ - = note: consider adding an explicit import of `repr` to disambiguate + = help: use `self::repr` to refer to this attribute macro unambiguously -error[E0659]: `repr` is ambiguous +error[E0659]: `repr` is ambiguous (built-in attribute vs any other name) --> $DIR/ambiguous-builtin-attrs.rs:11:19 | LL | #[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous | ^^^^ ambiguous name | -note: `repr` could refer to the name imported here + = note: `repr` could refer to a built-in attribute +note: `repr` could also refer to the attribute macro imported here --> $DIR/ambiguous-builtin-attrs.rs:7:5 | LL | use builtin_attrs::*; | ^^^^^^^^^^^^^^^^ -note: `repr` could also refer to the name defined here - --> $DIR/ambiguous-builtin-attrs.rs:11:19 - | -LL | #[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous - | ^^^^ - = note: consider adding an explicit import of `repr` to disambiguate + = help: use `self::repr` to refer to this attribute macro unambiguously -error[E0659]: `repr` is ambiguous +error[E0659]: `repr` is ambiguous (built-in attribute vs any other name) --> $DIR/ambiguous-builtin-attrs.rs:20:34 | LL | fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous | ^^^^ ambiguous name | -note: `repr` could refer to the name imported here + = note: `repr` could refer to a built-in attribute +note: `repr` could also refer to the attribute macro imported here --> $DIR/ambiguous-builtin-attrs.rs:7:5 | LL | use builtin_attrs::*; | ^^^^^^^^^^^^^^^^ -note: `repr` could also refer to the name defined here - --> $DIR/ambiguous-builtin-attrs.rs:20:34 - | -LL | fn non_macro_expanded_location<#[repr(C)] T>() { //~ ERROR `repr` is ambiguous - | ^^^^ - = note: consider adding an explicit import of `repr` to disambiguate + = help: use `self::repr` to refer to this attribute macro unambiguously -error[E0659]: `repr` is ambiguous +error[E0659]: `repr` is ambiguous (built-in attribute vs any other name) --> $DIR/ambiguous-builtin-attrs.rs:22:11 | LL | #[repr(C)] //~ ERROR `repr` is ambiguous | ^^^^ ambiguous name | -note: `repr` could refer to the name imported here + = note: `repr` could refer to a built-in attribute +note: `repr` could also refer to the attribute macro imported here --> $DIR/ambiguous-builtin-attrs.rs:7:5 | LL | use builtin_attrs::*; | ^^^^^^^^^^^^^^^^ -note: `repr` could also refer to the name defined here - --> $DIR/ambiguous-builtin-attrs.rs:22:11 - | -LL | #[repr(C)] //~ ERROR `repr` is ambiguous - | ^^^^ - = note: consider adding an explicit import of `repr` to disambiguate + = help: use `self::repr` to refer to this attribute macro unambiguously -error[E0659]: `feature` is ambiguous +error[E0659]: `feature` is ambiguous (built-in attribute vs any other name) --> $DIR/ambiguous-builtin-attrs.rs:3:4 | LL | #![feature(decl_macro)] //~ ERROR `feature` is ambiguous | ^^^^^^^ ambiguous name | -note: `feature` could refer to the name imported here + = note: `feature` could refer to a built-in attribute +note: `feature` could also refer to the attribute macro imported here --> $DIR/ambiguous-builtin-attrs.rs:7:5 | LL | use builtin_attrs::*; | ^^^^^^^^^^^^^^^^ -note: `feature` could also refer to the name defined here - --> $DIR/ambiguous-builtin-attrs.rs:3:4 - | -LL | #![feature(decl_macro)] //~ ERROR `feature` is ambiguous - | ^^^^^^^ - = note: consider adding an explicit import of `feature` to disambiguate - -error[E0425]: cannot find value `NonExistent` in this scope - --> $DIR/ambiguous-builtin-attrs.rs:30:5 - | -LL | NonExistent; //~ ERROR cannot find value `NonExistent` in this scope - | ^^^^^^^^^^^ not found in this scope + = help: use `self::feature` to refer to this attribute macro unambiguously error: aborting due to 6 previous errors diff --git a/src/test/ui-fulldeps/proc-macro/derive-helper-shadowing.stderr b/src/test/ui-fulldeps/proc-macro/derive-helper-shadowing.stderr index e0aeae4ba6c..f04782fac4d 100644 --- a/src/test/ui-fulldeps/proc-macro/derive-helper-shadowing.stderr +++ b/src/test/ui-fulldeps/proc-macro/derive-helper-shadowing.stderr @@ -1,19 +1,20 @@ -error[E0659]: `my_attr` is ambiguous +error[E0659]: `my_attr` is ambiguous (derive helper attribute vs any other name) --> $DIR/derive-helper-shadowing.rs:6:3 | LL | #[my_attr] //~ ERROR `my_attr` is ambiguous | ^^^^^^^ ambiguous name | -note: `my_attr` could refer to the name defined here +note: `my_attr` could refer to the derive helper attribute defined here --> $DIR/derive-helper-shadowing.rs:7:10 | LL | #[derive(MyTrait)] | ^^^^^^^ -note: `my_attr` could also refer to the name imported here +note: `my_attr` could also refer to the attribute macro imported here --> $DIR/derive-helper-shadowing.rs:4:5 | LL | use derive_helper_shadowing::*; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: use `self::my_attr` to refer to this attribute macro unambiguously error: aborting due to previous error diff --git a/src/test/ui/absolute-paths-in-nested-use-groups.stderr b/src/test/ui/absolute-paths-in-nested-use-groups.stderr index e88d26718a0..2bbd7b0ad3a 100644 --- a/src/test/ui/absolute-paths-in-nested-use-groups.stderr +++ b/src/test/ui/absolute-paths-in-nested-use-groups.stderr @@ -1,16 +1,16 @@ -error[E0433]: failed to resolve. crate root in paths can only be used in start position +error[E0433]: failed to resolve: crate root in paths can only be used in start position --> $DIR/absolute-paths-in-nested-use-groups.rs:16:5 | LL | ::bar, //~ ERROR crate root in paths can only be used in start position | ^ crate root in paths can only be used in start position -error[E0433]: failed to resolve. `super` in paths can only be used in start position +error[E0433]: failed to resolve: `super` in paths can only be used in start position --> $DIR/absolute-paths-in-nested-use-groups.rs:17:5 | LL | super::bar, //~ ERROR `super` in paths can only be used in start position | ^^^^^ `super` in paths can only be used in start position -error[E0433]: failed to resolve. `self` in paths can only be used in start position +error[E0433]: failed to resolve: `self` in paths can only be used in start position --> $DIR/absolute-paths-in-nested-use-groups.rs:18:5 | LL | self::bar, //~ ERROR `self` in paths can only be used in start position diff --git a/src/test/ui/bad/bad-module.rs b/src/test/ui/bad/bad-module.rs index 6987d06ef12..4f38d4ce45e 100644 --- a/src/test/ui/bad/bad-module.rs +++ b/src/test/ui/bad/bad-module.rs @@ -10,8 +10,8 @@ fn main() { let foo = thing::len(Vec::new()); - //~^ ERROR failed to resolve. Use of undeclared type or module `thing` + //~^ ERROR failed to resolve: use of undeclared type or module `thing` let foo = foo::bar::baz(); - //~^ ERROR failed to resolve. Use of undeclared type or module `foo` + //~^ ERROR failed to resolve: use of undeclared type or module `foo` } diff --git a/src/test/ui/bad/bad-module.stderr b/src/test/ui/bad/bad-module.stderr index 8c19922dcab..8bdcceaa191 100644 --- a/src/test/ui/bad/bad-module.stderr +++ b/src/test/ui/bad/bad-module.stderr @@ -1,14 +1,14 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `thing` +error[E0433]: failed to resolve: use of undeclared type or module `thing` --> $DIR/bad-module.rs:12:15 | LL | let foo = thing::len(Vec::new()); - | ^^^^^ Use of undeclared type or module `thing` + | ^^^^^ use of undeclared type or module `thing` -error[E0433]: failed to resolve. Use of undeclared type or module `foo` +error[E0433]: failed to resolve: use of undeclared type or module `foo` --> $DIR/bad-module.rs:15:15 | LL | let foo = foo::bar::baz(); - | ^^^ Use of undeclared type or module `foo` + | ^^^ use of undeclared type or module `foo` error: aborting due to 2 previous errors diff --git a/src/test/ui/custom-attribute-multisegment.rs b/src/test/ui/custom-attribute-multisegment.rs index a8d82a35946..354f7173872 100644 --- a/src/test/ui/custom-attribute-multisegment.rs +++ b/src/test/ui/custom-attribute-multisegment.rs @@ -14,5 +14,5 @@ mod existent {} -#[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent` +#[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent` fn main() {} diff --git a/src/test/ui/custom-attribute-multisegment.stderr b/src/test/ui/custom-attribute-multisegment.stderr index ff72d1c36d8..690ba4982ab 100644 --- a/src/test/ui/custom-attribute-multisegment.stderr +++ b/src/test/ui/custom-attribute-multisegment.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Could not find `nonexistent` in `existent` +error[E0433]: failed to resolve: could not find `nonexistent` in `existent` --> $DIR/custom-attribute-multisegment.rs:17:13 | -LL | #[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent` - | ^^^^^^^^^^^ Could not find `nonexistent` in `existent` +LL | #[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent` + | ^^^^^^^^^^^ could not find `nonexistent` in `existent` error: aborting due to previous error diff --git a/src/test/ui/derived-errors/issue-31997-1.stderr b/src/test/ui/derived-errors/issue-31997-1.stderr index 7cdcac3891f..5c5422f091b 100644 --- a/src/test/ui/derived-errors/issue-31997-1.stderr +++ b/src/test/ui/derived-errors/issue-31997-1.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `HashMap` +error[E0433]: failed to resolve: use of undeclared type or module `HashMap` --> $DIR/issue-31997-1.rs:30:19 | LL | let mut map = HashMap::new(); - | ^^^^^^^ Use of undeclared type or module `HashMap` + | ^^^^^^^ use of undeclared type or module `HashMap` error: aborting due to previous error diff --git a/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr b/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr index 0a0b1d573dd..fe9af74c01d 100644 --- a/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr +++ b/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr @@ -1,4 +1,4 @@ -error[E0433]: failed to resolve. `$crate` in paths can only be used in start position +error[E0433]: failed to resolve: `$crate` in paths can only be used in start position --> $DIR/dollar-crate-is-keyword-2.rs:16:16 | LL | use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position @@ -16,7 +16,7 @@ LL | use a::$crate; //~ ERROR unresolved import `a::$crate` LL | m!(); | ----- in this macro invocation -error[E0433]: failed to resolve. `$crate` in paths can only be used in start position +error[E0433]: failed to resolve: `$crate` in paths can only be used in start position --> $DIR/dollar-crate-is-keyword-2.rs:17:21 | LL | type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position diff --git a/src/test/ui/dyn-trait-compatibility.rs b/src/test/ui/dyn-trait-compatibility.rs index 454b6d2f566..4297e1b43d3 100644 --- a/src/test/ui/dyn-trait-compatibility.rs +++ b/src/test/ui/dyn-trait-compatibility.rs @@ -11,7 +11,7 @@ type A0 = dyn; //~^ ERROR cannot find type `dyn` in this scope type A1 = dyn::dyn; -//~^ ERROR Use of undeclared type or module `dyn` +//~^ ERROR use of undeclared type or module `dyn` type A2 = dyn<dyn, dyn>; //~^ ERROR cannot find type `dyn` in this scope //~| ERROR cannot find type `dyn` in this scope @@ -19,6 +19,6 @@ type A2 = dyn<dyn, dyn>; type A3 = dyn<<dyn as dyn>::dyn>; //~^ ERROR cannot find type `dyn` in this scope //~| ERROR cannot find type `dyn` in this scope -//~| ERROR Use of undeclared type or module `dyn` +//~| ERROR use of undeclared type or module `dyn` fn main() {} diff --git a/src/test/ui/dyn-trait-compatibility.stderr b/src/test/ui/dyn-trait-compatibility.stderr index 1ff3249371b..93048ccad6f 100644 --- a/src/test/ui/dyn-trait-compatibility.stderr +++ b/src/test/ui/dyn-trait-compatibility.stderr @@ -1,14 +1,14 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `dyn` +error[E0433]: failed to resolve: use of undeclared type or module `dyn` --> $DIR/dyn-trait-compatibility.rs:13:11 | LL | type A1 = dyn::dyn; - | ^^^ Use of undeclared type or module `dyn` + | ^^^ use of undeclared type or module `dyn` -error[E0433]: failed to resolve. Use of undeclared type or module `dyn` +error[E0433]: failed to resolve: use of undeclared type or module `dyn` --> $DIR/dyn-trait-compatibility.rs:19:23 | LL | type A3 = dyn<<dyn as dyn>::dyn>; - | ^^^ Use of undeclared type or module `dyn` + | ^^^ use of undeclared type or module `dyn` error[E0412]: cannot find type `dyn` in this scope --> $DIR/dyn-trait-compatibility.rs:11:11 diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr index 3d219b1752f..3708aa36089 100644 --- a/src/test/ui/empty/empty-struct-tuple-pat.stderr +++ b/src/test/ui/empty/empty-struct-tuple-pat.stderr @@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow tuple structs --> $DIR/empty-struct-tuple-pat.rs:32:9 | LL | struct Empty2(); - | ---------------- a tuple struct `Empty2` is defined here + | ---------------- the tuple struct `Empty2` is defined here ... LL | Empty2 => () //~ ERROR match bindings cannot shadow tuple structs | ^^^^^^ cannot be named the same as a tuple struct @@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow tuple structs --> $DIR/empty-struct-tuple-pat.rs:35:9 | LL | use empty_struct::*; - | --------------- a tuple struct `XEmpty6` is imported here + | --------------- the tuple struct `XEmpty6` is imported here ... LL | XEmpty6 => () //~ ERROR match bindings cannot shadow tuple structs | ^^^^^^^ cannot be named the same as a tuple struct diff --git a/src/test/ui/enum/enum-in-scope.stderr b/src/test/ui/enum/enum-in-scope.stderr index 1e8d5940495..b294aabb4ed 100644 --- a/src/test/ui/enum/enum-in-scope.stderr +++ b/src/test/ui/enum/enum-in-scope.stderr @@ -2,7 +2,7 @@ error[E0530]: let bindings cannot shadow tuple structs --> $DIR/enum-in-scope.rs:14:9 | LL | struct hello(isize); - | -------------------- a tuple struct `hello` is defined here + | -------------------- the tuple struct `hello` is defined here ... LL | let hello = 0; //~ERROR let bindings cannot shadow tuple structs | ^^^^^ cannot be named the same as a tuple struct diff --git a/src/test/ui/error-codes/E0432.stderr b/src/test/ui/error-codes/E0432.stderr index 291bb450755..d288cd086e7 100644 --- a/src/test/ui/error-codes/E0432.stderr +++ b/src/test/ui/error-codes/E0432.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `something` --> $DIR/E0432.rs:11:5 | LL | use something::Foo; //~ ERROR E0432 - | ^^^^^^^^^ Maybe a missing `extern crate something;`? + | ^^^^^^^^^ maybe a missing `extern crate something;`? error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0433.stderr b/src/test/ui/error-codes/E0433.stderr index f8cf5f6f92f..8a66e749ba8 100644 --- a/src/test/ui/error-codes/E0433.stderr +++ b/src/test/ui/error-codes/E0433.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `HashMap` +error[E0433]: failed to resolve: use of undeclared type or module `HashMap` --> $DIR/E0433.rs:12:15 | LL | let map = HashMap::new(); //~ ERROR E0433 - | ^^^^^^^ Use of undeclared type or module `HashMap` + | ^^^^^^^ use of undeclared type or module `HashMap` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0530.stderr b/src/test/ui/error-codes/E0530.stderr index e157ca9042c..96bc47a1afe 100644 --- a/src/test/ui/error-codes/E0530.stderr +++ b/src/test/ui/error-codes/E0530.stderr @@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics --> $DIR/E0530.rs:16:9 | LL | static TEST: i32 = 0; - | --------------------- a static `TEST` is defined here + | --------------------- the static `TEST` is defined here ... LL | TEST => {} //~ ERROR E0530 | ^^^^ cannot be named the same as a static diff --git a/src/test/ui/error-codes/E0659.stderr b/src/test/ui/error-codes/E0659.stderr index f168b7797ca..7bfe159405b 100644 --- a/src/test/ui/error-codes/E0659.stderr +++ b/src/test/ui/error-codes/E0659.stderr @@ -1,20 +1,21 @@ -error[E0659]: `foo` is ambiguous +error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module) --> $DIR/E0659.rs:25:15 | LL | collider::foo(); //~ ERROR E0659 | ^^^ ambiguous name | -note: `foo` could refer to the name imported here +note: `foo` could refer to the function imported here --> $DIR/E0659.rs:20:13 | LL | pub use moon::*; | ^^^^^^^ -note: `foo` could also refer to the name imported here + = help: consider adding an explicit import of `foo` to disambiguate +note: `foo` could also refer to the function imported here --> $DIR/E0659.rs:21:13 | LL | pub use earth::*; | ^^^^^^^^ - = note: consider adding an explicit import of `foo` to disambiguate + = help: consider adding an explicit import of `foo` to disambiguate error: aborting due to previous error diff --git a/src/test/ui/export-fully-qualified.rs b/src/test/ui/export-fully-qualified.rs index 19fa13f8377..422cd251de4 100644 --- a/src/test/ui/export-fully-qualified.rs +++ b/src/test/ui/export-fully-qualified.rs @@ -13,7 +13,7 @@ // want to change eventually. mod foo { - pub fn bar() { foo::baz(); } //~ ERROR failed to resolve. Use of undeclared type or module `foo` + pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared type or module `foo` fn baz() { } } diff --git a/src/test/ui/export-fully-qualified.stderr b/src/test/ui/export-fully-qualified.stderr index b8409929763..477cb4b1dd1 100644 --- a/src/test/ui/export-fully-qualified.stderr +++ b/src/test/ui/export-fully-qualified.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `foo` +error[E0433]: failed to resolve: use of undeclared type or module `foo` --> $DIR/export-fully-qualified.rs:16:20 | -LL | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve. Use of undeclared type or module `foo` - | ^^^ Use of undeclared type or module `foo` +LL | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared type or module `foo` + | ^^^ use of undeclared type or module `foo` error: aborting due to previous error diff --git a/src/test/ui/export2.rs b/src/test/ui/export2.rs index dc96ce7f504..4cc9762d975 100644 --- a/src/test/ui/export2.rs +++ b/src/test/ui/export2.rs @@ -9,7 +9,7 @@ // except according to those terms. mod foo { - pub fn x() { bar::x(); } //~ ERROR failed to resolve. Use of undeclared type or module `bar` + pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared type or module `bar` } mod bar { diff --git a/src/test/ui/export2.stderr b/src/test/ui/export2.stderr index c76afb8a1e2..7659183c8e0 100644 --- a/src/test/ui/export2.stderr +++ b/src/test/ui/export2.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `bar` +error[E0433]: failed to resolve: use of undeclared type or module `bar` --> $DIR/export2.rs:12:18 | -LL | pub fn x() { bar::x(); } //~ ERROR failed to resolve. Use of undeclared type or module `bar` - | ^^^ Use of undeclared type or module `bar` +LL | pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared type or module `bar` + | ^^^ use of undeclared type or module `bar` error: aborting due to previous error diff --git a/src/test/ui/extern/extern-macro.rs b/src/test/ui/extern/extern-macro.rs index 4b1bf7d8f79..88a72778a85 100644 --- a/src/test/ui/extern/extern-macro.rs +++ b/src/test/ui/extern/extern-macro.rs @@ -12,5 +12,5 @@ fn main() { enum Foo {} - let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path + let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro } diff --git a/src/test/ui/extern/extern-macro.stderr b/src/test/ui/extern/extern-macro.stderr index b5515bfcc64..6123d970166 100644 --- a/src/test/ui/extern/extern-macro.stderr +++ b/src/test/ui/extern/extern-macro.stderr @@ -1,8 +1,9 @@ -error: fail to resolve non-ident macro path +error[E0433]: failed to resolve: partially resolved path in a macro --> $DIR/extern-macro.rs:15:13 | -LL | let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path - | ^^^^^^^^ +LL | let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro + | ^^^^^^^^ partially resolved path in a macro error: aborting due to previous error +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr b/src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr index 7a996abc767..7c94200f00f 100644 --- a/src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr +++ b/src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr @@ -2,13 +2,13 @@ error[E0432]: unresolved import `core` --> $DIR/feature-gate-extern_absolute_paths.rs:11:5 | LL | use core::default; //~ ERROR unresolved import `core` - | ^^^^ Maybe a missing `extern crate core;`? + | ^^^^ maybe a missing `extern crate core;`? -error[E0433]: failed to resolve. Maybe a missing `extern crate core;`? +error[E0433]: failed to resolve: maybe a missing `extern crate core;`? --> $DIR/feature-gate-extern_absolute_paths.rs:14:19 | LL | let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve - | ^^^^ Maybe a missing `extern crate core;`? + | ^^^^ maybe a missing `extern crate core;`? error: aborting due to 2 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.rs b/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.rs index a043b6c2e61..27b9a34ff4e 100644 --- a/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.rs +++ b/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(alloc)] +#![feature(alloc, underscore_imports)] extern crate alloc; @@ -23,7 +23,7 @@ mod absolute { } mod import_in_scope { - use alloc; + use alloc as _; //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable use alloc::boxed; //~^ ERROR use of extern prelude names introduced with `extern crate` items is unstable diff --git a/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.stderr b/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.stderr index bbd4b630263..103ab79ef84 100644 --- a/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.stderr +++ b/src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.stderr @@ -1,7 +1,7 @@ error[E0658]: use of extern prelude names introduced with `extern crate` items is unstable (see issue #55599) --> $DIR/feature-gate-extern_crate_item_prelude.rs:26:9 | -LL | use alloc; +LL | use alloc as _; | ^^^^^ | = help: add #![feature(extern_crate_item_prelude)] to the crate attributes to enable diff --git a/src/test/ui/feature-gates/feature-gate-uniform-paths.rs b/src/test/ui/feature-gates/feature-gate-uniform-paths.rs index 140655d52bd..ca1cc1d2fd0 100644 --- a/src/test/ui/feature-gates/feature-gate-uniform-paths.rs +++ b/src/test/ui/feature-gates/feature-gate-uniform-paths.rs @@ -8,15 +8,22 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// edition:2018 + pub mod foo { - pub use bar::Bar; - //~^ ERROR unresolved import `bar` + pub use bar::Bar; //~ ERROR imports can only refer to extern crate names pub mod bar { pub struct Bar; } } +use inline; //~ ERROR imports can only refer to extern crate names + +use Vec; //~ ERROR imports can only refer to extern crate names + +use vec; //~ ERROR imports can only refer to extern crate names + fn main() { let _ = foo::Bar; } diff --git a/src/test/ui/feature-gates/feature-gate-uniform-paths.stderr b/src/test/ui/feature-gates/feature-gate-uniform-paths.stderr index 68faacfcbe7..ec8937bbc5f 100644 --- a/src/test/ui/feature-gates/feature-gate-uniform-paths.stderr +++ b/src/test/ui/feature-gates/feature-gate-uniform-paths.stderr @@ -1,9 +1,62 @@ -error[E0432]: unresolved import `bar` - --> $DIR/feature-gate-uniform-paths.rs:12:13 +error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130) + --> $DIR/feature-gate-uniform-paths.rs:14:13 | -LL | pub use bar::Bar; - | ^^^ Did you mean `self::bar`? +LL | pub use bar::Bar; //~ ERROR imports can only refer to extern crate names + | ^^^ +LL | +LL | / pub mod bar { +LL | | pub struct Bar; +LL | | } + | |_____- not an extern crate passed with `--extern` + | + = help: add #![feature(uniform_paths)] to the crate attributes to enable +note: this import refers to the module defined here + --> $DIR/feature-gate-uniform-paths.rs:16:5 + | +LL | / pub mod bar { +LL | | pub struct Bar; +LL | | } + | |_____^ + +error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130) + --> $DIR/feature-gate-uniform-paths.rs:21:5 + | +LL | use inline; //~ ERROR imports can only refer to extern crate names + | ^^^^^^ not an extern crate passed with `--extern` + | + = help: add #![feature(uniform_paths)] to the crate attributes to enable +note: this import refers to the built-in attribute imported here + --> $DIR/feature-gate-uniform-paths.rs:21:5 + | +LL | use inline; //~ ERROR imports can only refer to extern crate names + | ^^^^^^ + +error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130) + --> $DIR/feature-gate-uniform-paths.rs:23:5 + | +LL | use Vec; //~ ERROR imports can only refer to extern crate names + | ^^^ not an extern crate passed with `--extern` + | + = help: add #![feature(uniform_paths)] to the crate attributes to enable +note: this import refers to the struct imported here + --> $DIR/feature-gate-uniform-paths.rs:23:5 + | +LL | use Vec; //~ ERROR imports can only refer to extern crate names + | ^^^ + +error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130) + --> $DIR/feature-gate-uniform-paths.rs:25:5 + | +LL | use vec; //~ ERROR imports can only refer to extern crate names + | ^^^ not an extern crate passed with `--extern` + | + = help: add #![feature(uniform_paths)] to the crate attributes to enable +note: this import refers to the macro imported here + --> $DIR/feature-gate-uniform-paths.rs:25:5 + | +LL | use vec; //~ ERROR imports can only refer to extern crate names + | ^^^ -error: aborting due to previous error +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0432`. +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index 463fdbf00ce..73a63a2c7f5 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -1,11 +1,11 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `Vec` +error[E0433]: failed to resolve: use of undeclared type or module `Vec` --> $DIR/no_implicit_prelude.rs:21:9 | LL | fn f() { ::bar::m!(); } | ------------ in this macro invocation ... LL | Vec::new(); //~ ERROR failed to resolve - | ^^^ Use of undeclared type or module `Vec` + | ^^^ use of undeclared type or module `Vec` error[E0599]: no method named `clone` found for type `()` in the current scope --> $DIR/no_implicit_prelude.rs:22:12 diff --git a/src/test/ui/import2.rs b/src/test/ui/import2.rs index c4bd9ff1e2a..d3bbdf15cd0 100644 --- a/src/test/ui/import2.rs +++ b/src/test/ui/import2.rs @@ -9,7 +9,7 @@ // except according to those terms. use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432] - //~^ Could not find `zed` in `baz` + //~^ could not find `zed` in `baz` mod baz {} mod zed { diff --git a/src/test/ui/import2.stderr b/src/test/ui/import2.stderr index c07506845c4..b1973937701 100644 --- a/src/test/ui/import2.stderr +++ b/src/test/ui/import2.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `baz::zed` --> $DIR/import2.rs:11:10 | LL | use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432] - | ^^^ Could not find `zed` in `baz` + | ^^^ could not find `zed` in `baz` error: aborting due to previous error diff --git a/src/test/ui/import3.stderr b/src/test/ui/import3.stderr index 5211b862b3d..a4c367fb073 100644 --- a/src/test/ui/import3.stderr +++ b/src/test/ui/import3.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `main` --> $DIR/import3.rs:12:5 | LL | use main::bar; - | ^^^^ Maybe a missing `extern crate main;`? + | ^^^^ maybe a missing `extern crate main;`? error: aborting due to previous error diff --git a/src/test/ui/imports/auxiliary/glob-conflict.rs b/src/test/ui/imports/auxiliary/glob-conflict.rs new file mode 100644 index 00000000000..ac12ed9c81c --- /dev/null +++ b/src/test/ui/imports/auxiliary/glob-conflict.rs @@ -0,0 +1,9 @@ +mod m1 { + pub fn f() {} +} +mod m2 { + pub fn f(_: u8) {} +} + +pub use m1::*; +pub use m2::*; diff --git a/src/test/ui/imports/duplicate.stderr b/src/test/ui/imports/duplicate.stderr index 5d51981e8af..f53ba9cd5de 100644 --- a/src/test/ui/imports/duplicate.stderr +++ b/src/test/ui/imports/duplicate.stderr @@ -12,77 +12,81 @@ help: you can use `as` to change the binding name of the import LL | use a::foo as other_foo; //~ ERROR the name `foo` is defined multiple times | ^^^^^^^^^^^^^^^^^^^ -error[E0659]: `foo` is ambiguous +error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module) --> $DIR/duplicate.rs:56:15 | LL | use self::foo::bar; //~ ERROR `foo` is ambiguous | ^^^ ambiguous name | -note: `foo` could refer to the name imported here +note: `foo` could refer to the module imported here --> $DIR/duplicate.rs:53:9 | LL | use self::m1::*; | ^^^^^^^^^^^ -note: `foo` could also refer to the name imported here + = help: consider adding an explicit import of `foo` to disambiguate +note: `foo` could also refer to the module imported here --> $DIR/duplicate.rs:54:9 | LL | use self::m2::*; | ^^^^^^^^^^^ - = note: consider adding an explicit import of `foo` to disambiguate + = help: consider adding an explicit import of `foo` to disambiguate -error[E0659]: `foo` is ambiguous +error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module) --> $DIR/duplicate.rs:45:8 | LL | f::foo(); //~ ERROR `foo` is ambiguous | ^^^ ambiguous name | -note: `foo` could refer to the name imported here +note: `foo` could refer to the function imported here --> $DIR/duplicate.rs:34:13 | LL | pub use a::*; | ^^^^ -note: `foo` could also refer to the name imported here + = help: consider adding an explicit import of `foo` to disambiguate +note: `foo` could also refer to the function imported here --> $DIR/duplicate.rs:35:13 | LL | pub use b::*; | ^^^^ - = note: consider adding an explicit import of `foo` to disambiguate + = help: consider adding an explicit import of `foo` to disambiguate -error[E0659]: `foo` is ambiguous +error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module) --> $DIR/duplicate.rs:46:8 | LL | g::foo(); //~ ERROR `foo` is ambiguous | ^^^ ambiguous name | -note: `foo` could refer to the name imported here +note: `foo` could refer to the function imported here --> $DIR/duplicate.rs:39:13 | LL | pub use a::*; | ^^^^ -note: `foo` could also refer to the name imported here + = help: consider adding an explicit import of `foo` to disambiguate +note: `foo` could also refer to the unresolved item imported here --> $DIR/duplicate.rs:40:13 | LL | pub use f::*; | ^^^^ - = note: consider adding an explicit import of `foo` to disambiguate + = help: consider adding an explicit import of `foo` to disambiguate -error[E0659]: `foo` is ambiguous +error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module) --> $DIR/duplicate.rs:59:9 | LL | foo::bar(); //~ ERROR `foo` is ambiguous | ^^^ ambiguous name | -note: `foo` could refer to the name imported here +note: `foo` could refer to the module imported here --> $DIR/duplicate.rs:53:9 | LL | use self::m1::*; | ^^^^^^^^^^^ -note: `foo` could also refer to the name imported here + = help: consider adding an explicit import of `foo` to disambiguate +note: `foo` could also refer to the module imported here --> $DIR/duplicate.rs:54:9 | LL | use self::m2::*; | ^^^^^^^^^^^ - = note: consider adding an explicit import of `foo` to disambiguate + = help: consider adding an explicit import of `foo` to disambiguate error: aborting due to 5 previous errors diff --git a/src/test/ui/imports/extern-prelude-extern-crate-fail.rs b/src/test/ui/imports/extern-prelude-extern-crate-fail.rs index 57b097c9df3..6b70efe0c44 100644 --- a/src/test/ui/imports/extern-prelude-extern-crate-fail.rs +++ b/src/test/ui/imports/extern-prelude-extern-crate-fail.rs @@ -7,7 +7,7 @@ mod n { mod m { fn check() { - two_macros::m!(); //~ ERROR failed to resolve. Use of undeclared type or module `two_macros` + two_macros::m!(); //~ ERROR failed to resolve: use of undeclared type or module `two_macros` } } diff --git a/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr b/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr index 8f68d2af34c..baeed02517d 100644 --- a/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr +++ b/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr @@ -7,11 +7,11 @@ LL | extern crate std as non_existent; LL | define_std_as_non_existent!(); | ------------------------------ in this macro invocation -error[E0433]: failed to resolve. Use of undeclared type or module `two_macros` +error[E0433]: failed to resolve: use of undeclared type or module `two_macros` --> $DIR/extern-prelude-extern-crate-fail.rs:10:9 | -LL | two_macros::m!(); //~ ERROR failed to resolve. Use of undeclared type or module `two_macros` - | ^^^^^^^^^^ Use of undeclared type or module `two_macros` +LL | two_macros::m!(); //~ ERROR failed to resolve: use of undeclared type or module `two_macros` + | ^^^^^^^^^^ use of undeclared type or module `two_macros` error: aborting due to 2 previous errors diff --git a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr index 6c832e70e49..218dfb796f7 100644 --- a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr +++ b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr @@ -1,10 +1,11 @@ -error[E0659]: `Vec` is ambiguous +error[E0659]: `Vec` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:15:9 | LL | Vec::panic!(); //~ ERROR `Vec` is ambiguous | ^^^ ambiguous name | -note: `Vec` could refer to the name defined here + = note: `Vec` could refer to a struct from prelude +note: `Vec` could also refer to the extern crate imported here --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:7:9 | LL | extern crate std as Vec; @@ -12,8 +13,6 @@ LL | extern crate std as Vec; ... LL | define_vec!(); | -------------- in this macro invocation -note: `Vec` could also refer to the name defined here - = note: macro-expanded items do not shadow when used in a macro invocation path error: aborting due to previous error diff --git a/src/test/ui/imports/glob-conflict-cross-crate.rs b/src/test/ui/imports/glob-conflict-cross-crate.rs new file mode 100644 index 00000000000..e02148b19f7 --- /dev/null +++ b/src/test/ui/imports/glob-conflict-cross-crate.rs @@ -0,0 +1,7 @@ +// aux-build:glob-conflict.rs + +extern crate glob_conflict; + +fn main() { + glob_conflict::f(); //~ ERROR cannot find function `f` in module `glob_conflict` +} diff --git a/src/test/ui/imports/glob-conflict-cross-crate.stderr b/src/test/ui/imports/glob-conflict-cross-crate.stderr new file mode 100644 index 00000000000..f64637fd6f6 --- /dev/null +++ b/src/test/ui/imports/glob-conflict-cross-crate.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `f` in module `glob_conflict` + --> $DIR/glob-conflict-cross-crate.rs:6:20 + | +LL | glob_conflict::f(); //~ ERROR cannot find function `f` in module `glob_conflict` + | ^ not found in `glob_conflict` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/imports/glob-shadowing.stderr b/src/test/ui/imports/glob-shadowing.stderr index 33a2963fa29..6a4774facd7 100644 --- a/src/test/ui/imports/glob-shadowing.stderr +++ b/src/test/ui/imports/glob-shadowing.stderr @@ -1,48 +1,50 @@ -error[E0659]: `env` is ambiguous +error[E0659]: `env` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) --> $DIR/glob-shadowing.rs:21:17 | LL | let x = env!("PATH"); //~ ERROR `env` is ambiguous | ^^^ ambiguous name | -note: `env` could refer to the name imported here + = note: `env` could refer to a built-in macro +note: `env` could also refer to the macro imported here --> $DIR/glob-shadowing.rs:19:9 | LL | use m::*; | ^^^^ - = note: `env` is also a builtin macro - = note: consider adding an explicit import of `env` to disambiguate + = help: consider adding an explicit import of `env` to disambiguate + = help: or use `self::env` to refer to this macro unambiguously -error[E0659]: `env` is ambiguous +error[E0659]: `env` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) --> $DIR/glob-shadowing.rs:29:21 | LL | let x = env!("PATH"); //~ ERROR `env` is ambiguous | ^^^ ambiguous name | -note: `env` could refer to the name imported here + = note: `env` could refer to a built-in macro +note: `env` could also refer to the macro imported here --> $DIR/glob-shadowing.rs:27:13 | LL | use m::*; | ^^^^ - = note: `env` is also a builtin macro - = note: consider adding an explicit import of `env` to disambiguate + = help: consider adding an explicit import of `env` to disambiguate -error[E0659]: `fenv` is ambiguous +error[E0659]: `fenv` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) --> $DIR/glob-shadowing.rs:39:21 | LL | let x = fenv!(); //~ ERROR `fenv` is ambiguous | ^^^^ ambiguous name | -note: `fenv` could refer to the name imported here +note: `fenv` could refer to the macro imported here --> $DIR/glob-shadowing.rs:37:13 | LL | use m::*; | ^^^^ -note: `fenv` could also refer to the name defined here + = help: consider adding an explicit import of `fenv` to disambiguate +note: `fenv` could also refer to the macro defined here --> $DIR/glob-shadowing.rs:35:5 | LL | pub macro fenv($e: expr) { $e } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: consider adding an explicit import of `fenv` to disambiguate + = help: use `self::fenv` to refer to this macro unambiguously error: aborting due to 3 previous errors diff --git a/src/test/ui/imports/issue-53269.stderr b/src/test/ui/imports/issue-53269.stderr index e125983151d..0ed26ea6fe6 100644 --- a/src/test/ui/imports/issue-53269.stderr +++ b/src/test/ui/imports/issue-53269.stderr @@ -2,24 +2,25 @@ error[E0432]: unresolved import `nonexistent_module` --> $DIR/issue-53269.rs:16:9 | LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module` - | ^^^^^^^^^^^^^^^^^^ Maybe a missing `extern crate nonexistent_module;`? + | ^^^^^^^^^^^^^^^^^^ maybe a missing `extern crate nonexistent_module;`? -error[E0659]: `mac` is ambiguous +error[E0659]: `mac` is ambiguous (`macro_rules` vs non-`macro_rules` from other module) --> $DIR/issue-53269.rs:18:5 | LL | mac!(); //~ ERROR `mac` is ambiguous | ^^^ ambiguous name | -note: `mac` could refer to the name defined here +note: `mac` could refer to the macro defined here --> $DIR/issue-53269.rs:13:1 | LL | macro_rules! mac { () => () } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: `mac` could also refer to the name imported here +note: `mac` could also refer to the unresolved item imported here --> $DIR/issue-53269.rs:16:9 | LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module` | ^^^^^^^^^^^^^^^^^^^^^^^ + = help: use `self::mac` to refer to this unresolved item unambiguously error: aborting due to 2 previous errors diff --git a/src/test/ui/imports/issue-55457.stderr b/src/test/ui/imports/issue-55457.stderr index 363dec06237..4ee0332d04b 100644 --- a/src/test/ui/imports/issue-55457.stderr +++ b/src/test/ui/imports/issue-55457.stderr @@ -8,7 +8,7 @@ error[E0432]: unresolved import `non_existent` --> $DIR/issue-55457.rs:2:5 | LL | use non_existent::non_existent; //~ ERROR unresolved import `non_existent` - | ^^^^^^^^^^^^ Maybe a missing `extern crate non_existent;`? + | ^^^^^^^^^^^^ maybe a missing `extern crate non_existent;`? error: cannot determine resolution for the derive macro `NonExistent` --> $DIR/issue-55457.rs:5:10 diff --git a/src/test/ui/imports/issue-55884-1.rs b/src/test/ui/imports/issue-55884-1.rs new file mode 100644 index 00000000000..21744aa5d7b --- /dev/null +++ b/src/test/ui/imports/issue-55884-1.rs @@ -0,0 +1,21 @@ +mod m { + mod m1 { + pub struct S {} + } + mod m2 { + // Note this derive, it makes this struct macro-expanded, + // so it doesn't appear in time to participate in the initial resolution of `use m::S`, + // only in the later validation pass. + #[derive(Default)] + pub struct S {} + } + + // Create a glob vs glob ambiguity + pub use self::m1::*; + pub use self::m2::*; +} + +fn main() { + use m::S; //~ ERROR `S` is ambiguous + let s = S {}; +} diff --git a/src/test/ui/imports/issue-55884-1.stderr b/src/test/ui/imports/issue-55884-1.stderr new file mode 100644 index 00000000000..477e859d081 --- /dev/null +++ b/src/test/ui/imports/issue-55884-1.stderr @@ -0,0 +1,22 @@ +error[E0659]: `S` is ambiguous (glob import vs glob import in the same module) + --> $DIR/issue-55884-1.rs:19:12 + | +LL | use m::S; //~ ERROR `S` is ambiguous + | ^ ambiguous name + | +note: `S` could refer to the struct imported here + --> $DIR/issue-55884-1.rs:14:13 + | +LL | pub use self::m1::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `S` to disambiguate +note: `S` could also refer to the struct imported here + --> $DIR/issue-55884-1.rs:15:13 + | +LL | pub use self::m2::*; + | ^^^^^^^^^^^ + = help: consider adding an explicit import of `S` to disambiguate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/imports/issue-55884-2.rs b/src/test/ui/imports/issue-55884-2.rs new file mode 100644 index 00000000000..1b4f652c9fc --- /dev/null +++ b/src/test/ui/imports/issue-55884-2.rs @@ -0,0 +1,14 @@ +mod options { + pub struct ParseOptions {} +} + +mod parser { + pub use options::*; + // Private single import shadows public glob import, but arrives too late for initial + // resolution of `use parser::ParseOptions` because it depends on that resolution itself. + use ParseOptions; +} + +pub use parser::ParseOptions; //~ ERROR struct `ParseOptions` is private + +fn main() {} diff --git a/src/test/ui/imports/issue-55884-2.stderr b/src/test/ui/imports/issue-55884-2.stderr new file mode 100644 index 00000000000..f8a6cb4a580 --- /dev/null +++ b/src/test/ui/imports/issue-55884-2.stderr @@ -0,0 +1,9 @@ +error[E0603]: struct `ParseOptions` is private + --> $DIR/issue-55884-2.rs:12:17 + | +LL | pub use parser::ParseOptions; //~ ERROR struct `ParseOptions` is private + | ^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr index 9c475451ce3..962294e48ca 100644 --- a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr +++ b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr @@ -1,10 +1,10 @@ -error[E0659]: `exported` is ambiguous +error[E0659]: `exported` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution) --> $DIR/local-modularized-tricky-fail-1.rs:38:1 | LL | exported!(); //~ ERROR `exported` is ambiguous | ^^^^^^^^ ambiguous name | -note: `exported` could refer to the name defined here +note: `exported` could refer to the macro defined here --> $DIR/local-modularized-tricky-fail-1.rs:15:5 | LL | / macro_rules! exported { @@ -14,20 +14,21 @@ LL | | } ... LL | define_exported!(); | ------------------- in this macro invocation -note: `exported` could also refer to the name imported here +note: `exported` could also refer to the macro imported here --> $DIR/local-modularized-tricky-fail-1.rs:32:5 | LL | use inner1::*; | ^^^^^^^^^ - = note: macro-expanded macros do not shadow + = help: consider adding an explicit import of `exported` to disambiguate -error[E0659]: `include` is ambiguous +error[E0659]: `include` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/local-modularized-tricky-fail-1.rs:56:1 | LL | include!(); //~ ERROR `include` is ambiguous | ^^^^^^^ ambiguous name | -note: `include` could refer to the name defined here + = note: `include` could refer to a built-in macro +note: `include` could also refer to the macro defined here --> $DIR/local-modularized-tricky-fail-1.rs:27:5 | LL | / macro_rules! include { @@ -37,16 +38,16 @@ LL | | } ... LL | define_include!(); | ------------------ in this macro invocation - = note: `include` is also a builtin macro - = note: macro-expanded macros do not shadow + = help: use `self::include` to refer to this macro unambiguously -error[E0659]: `panic` is ambiguous +error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/local-modularized-tricky-fail-1.rs:45:5 | LL | panic!(); //~ ERROR `panic` is ambiguous | ^^^^^ ambiguous name | -note: `panic` could refer to the name defined here + = note: `panic` could refer to a macro from prelude +note: `panic` could also refer to the macro defined here --> $DIR/local-modularized-tricky-fail-1.rs:21:5 | LL | / macro_rules! panic { @@ -56,16 +57,16 @@ LL | | } ... LL | define_panic!(); | ---------------- in this macro invocation - = note: `panic` is also a builtin macro - = note: macro-expanded macros do not shadow + = help: use `self::panic` to refer to this macro unambiguously -error[E0659]: `panic` is ambiguous +error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> <::std::macros::panic macros>:1:13 | LL | ( ) => ( { panic ! ( "explicit panic" ) } ) ; ( $ msg : expr ) => ( | ^^^^^ ambiguous name | -note: `panic` could refer to the name defined here + = note: `panic` could refer to a macro from prelude +note: `panic` could also refer to the macro defined here --> $DIR/local-modularized-tricky-fail-1.rs:21:5 | LL | / macro_rules! panic { @@ -75,8 +76,7 @@ LL | | } ... LL | define_panic!(); | ---------------- in this macro invocation - = note: `panic` is also a builtin macro - = note: macro-expanded macros do not shadow + = help: use `self::panic` to refer to this macro unambiguously error: aborting due to 4 previous errors diff --git a/src/test/ui/imports/macro-paths.stderr b/src/test/ui/imports/macro-paths.stderr index a612c64c2f4..8e8742f849b 100644 --- a/src/test/ui/imports/macro-paths.stderr +++ b/src/test/ui/imports/macro-paths.stderr @@ -1,40 +1,40 @@ -error[E0659]: `bar` is ambiguous +error[E0659]: `bar` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution) --> $DIR/macro-paths.rs:23:5 | LL | bar::m! { //~ ERROR ambiguous | ^^^ ambiguous name | -note: `bar` could refer to the name defined here +note: `bar` could refer to the module defined here --> $DIR/macro-paths.rs:24:9 | LL | mod bar { pub use two_macros::m; } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: `bar` could also refer to the name imported here +note: `bar` could also refer to the module imported here --> $DIR/macro-paths.rs:22:9 | LL | use foo::*; | ^^^^^^ - = note: macro-expanded items do not shadow when used in a macro invocation path + = help: consider adding an explicit import of `bar` to disambiguate -error[E0659]: `baz` is ambiguous +error[E0659]: `baz` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/macro-paths.rs:33:5 | LL | baz::m! { //~ ERROR ambiguous | ^^^ ambiguous name | -note: `baz` could refer to the name defined here +note: `baz` could refer to the module defined here --> $DIR/macro-paths.rs:34:9 | LL | mod baz { pub use two_macros::m; } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: `baz` could also refer to the name defined here +note: `baz` could also refer to the module defined here --> $DIR/macro-paths.rs:28:1 | LL | / pub mod baz { LL | | pub use two_macros::m; LL | | } | |_^ - = note: macro-expanded items do not shadow when used in a macro invocation path + = help: use `self::baz` to refer to this module unambiguously error: aborting due to 2 previous errors diff --git a/src/test/ui/imports/macros.stderr b/src/test/ui/imports/macros.stderr index 209d449dfd8..77a0311fa60 100644 --- a/src/test/ui/imports/macros.stderr +++ b/src/test/ui/imports/macros.stderr @@ -1,38 +1,38 @@ -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution) --> $DIR/macros.rs:26:5 | LL | m! { //~ ERROR ambiguous | ^ ambiguous name | -note: `m` could refer to the name imported here +note: `m` could refer to the macro imported here --> $DIR/macros.rs:27:13 | LL | use foo::m; | ^^^^^^ -note: `m` could also refer to the name imported here +note: `m` could also refer to the macro imported here --> $DIR/macros.rs:25:9 | LL | use two_macros::*; | ^^^^^^^^^^^^^ - = note: macro-expanded macro imports do not shadow + = help: consider adding an explicit import of `m` to disambiguate -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/macros.rs:39:9 | LL | m! { //~ ERROR ambiguous | ^ ambiguous name | -note: `m` could refer to the name imported here +note: `m` could refer to the macro imported here --> $DIR/macros.rs:40:17 | LL | use two_macros::n as m; | ^^^^^^^^^^^^^^^^^^ -note: `m` could also refer to the name imported here +note: `m` could also refer to the macro imported here --> $DIR/macros.rs:32:9 | LL | use two_macros::m; | ^^^^^^^^^^^^^ - = note: macro-expanded macro imports do not shadow + = help: use `self::m` to refer to this macro unambiguously error: aborting due to 2 previous errors diff --git a/src/test/ui/imports/rfc-1560-warning-cycle.stderr b/src/test/ui/imports/rfc-1560-warning-cycle.stderr index 91af3a4b6ac..946dc084cd0 100644 --- a/src/test/ui/imports/rfc-1560-warning-cycle.stderr +++ b/src/test/ui/imports/rfc-1560-warning-cycle.stderr @@ -1,20 +1,21 @@ -error[E0659]: `Foo` is ambiguous +error[E0659]: `Foo` is ambiguous (glob import vs glob import in the same module) --> $DIR/rfc-1560-warning-cycle.rs:19:17 | LL | fn f(_: Foo) {} //~ ERROR `Foo` is ambiguous | ^^^ ambiguous name | -note: `Foo` could refer to the name imported here +note: `Foo` could refer to the struct imported here --> $DIR/rfc-1560-warning-cycle.rs:17:13 | LL | use *; | ^ -note: `Foo` could also refer to the name imported here + = help: consider adding an explicit import of `Foo` to disambiguate +note: `Foo` could also refer to the struct imported here --> $DIR/rfc-1560-warning-cycle.rs:18:13 | LL | use bar::*; | ^^^^^^ - = note: consider adding an explicit import of `Foo` to disambiguate + = help: consider adding an explicit import of `Foo` to disambiguate error: aborting due to previous error diff --git a/src/test/ui/imports/shadow_builtin_macros.stderr b/src/test/ui/imports/shadow_builtin_macros.stderr index 7e5ab0c5abe..b53b7e2700d 100644 --- a/src/test/ui/imports/shadow_builtin_macros.stderr +++ b/src/test/ui/imports/shadow_builtin_macros.stderr @@ -1,38 +1,40 @@ -error[E0659]: `panic` is ambiguous +error[E0659]: `panic` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) --> $DIR/shadow_builtin_macros.rs:25:14 | LL | fn f() { panic!(); } //~ ERROR ambiguous | ^^^^^ ambiguous name | -note: `panic` could refer to the name imported here + = note: `panic` could refer to a macro from prelude +note: `panic` could also refer to the macro imported here --> $DIR/shadow_builtin_macros.rs:24:9 | LL | use foo::*; | ^^^^^^ - = note: `panic` is also a builtin macro - = note: consider adding an explicit import of `panic` to disambiguate + = help: consider adding an explicit import of `panic` to disambiguate + = help: or use `self::panic` to refer to this macro unambiguously -error[E0659]: `panic` is ambiguous +error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/shadow_builtin_macros.rs:30:14 | LL | fn f() { panic!(); } //~ ERROR ambiguous | ^^^^^ ambiguous name | -note: `panic` could refer to the name imported here + = note: `panic` could refer to a macro from prelude +note: `panic` could also refer to the macro imported here --> $DIR/shadow_builtin_macros.rs:29:26 | LL | ::two_macros::m!(use foo::panic;); | ^^^^^^^^^^ - = note: `panic` is also a builtin macro - = note: macro-expanded macro imports do not shadow + = help: use `self::panic` to refer to this macro unambiguously -error[E0659]: `panic` is ambiguous +error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/shadow_builtin_macros.rs:43:5 | LL | panic!(); //~ ERROR `panic` is ambiguous | ^^^^^ ambiguous name | -note: `panic` could refer to the name defined here + = note: `panic` could refer to a macro from prelude +note: `panic` could also refer to the macro defined here --> $DIR/shadow_builtin_macros.rs:40:9 | LL | macro_rules! panic { () => {} } @@ -40,26 +42,25 @@ LL | macro_rules! panic { () => {} } LL | } } LL | m!(); | ----- in this macro invocation - = note: `panic` is also a builtin macro - = note: macro-expanded macros do not shadow -error[E0659]: `n` is ambiguous +error[E0659]: `n` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) --> $DIR/shadow_builtin_macros.rs:59:5 | LL | n!(); //~ ERROR ambiguous | ^ ambiguous name | -note: `n` could refer to the name imported here +note: `n` could refer to the macro imported here --> $DIR/shadow_builtin_macros.rs:58:9 | LL | use bar::*; | ^^^^^^ -note: `n` could also refer to the name imported here + = help: consider adding an explicit import of `n` to disambiguate + = help: or use `self::n` to refer to this macro unambiguously +note: `n` could also refer to the macro imported here --> $DIR/shadow_builtin_macros.rs:46:13 | LL | #[macro_use(n)] | ^ - = note: consider adding an explicit import of `n` to disambiguate error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-16149.stderr b/src/test/ui/issues/issue-16149.stderr index b0b6e9dfcd0..284ed035526 100644 --- a/src/test/ui/issues/issue-16149.stderr +++ b/src/test/ui/issues/issue-16149.stderr @@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics --> $DIR/issue-16149.rs:17:9 | LL | static externalValue: isize; - | ---------------------------- a static `externalValue` is defined here + | ---------------------------- the static `externalValue` is defined here ... LL | externalValue => true, | ^^^^^^^^^^^^^ cannot be named the same as a static diff --git a/src/test/ui/issues/issue-1697.rs b/src/test/ui/issues/issue-1697.rs index f8a68264339..43f92d8c3de 100644 --- a/src/test/ui/issues/issue-1697.rs +++ b/src/test/ui/issues/issue-1697.rs @@ -11,6 +11,6 @@ // Testing that we don't fail abnormally after hitting the errors use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432] - //~^ Maybe a missing `extern crate unresolved;`? + //~^ maybe a missing `extern crate unresolved;`? fn main() {} diff --git a/src/test/ui/issues/issue-1697.stderr b/src/test/ui/issues/issue-1697.stderr index 28a7fbcaabe..b588c883264 100644 --- a/src/test/ui/issues/issue-1697.stderr +++ b/src/test/ui/issues/issue-1697.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `unresolved` --> $DIR/issue-1697.rs:13:5 | LL | use unresolved::*; //~ ERROR unresolved import `unresolved` [E0432] - | ^^^^^^^^^^ Maybe a missing `extern crate unresolved;`? + | ^^^^^^^^^^ maybe a missing `extern crate unresolved;`? error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17718-patterns.stderr b/src/test/ui/issues/issue-17718-patterns.stderr index 13cab9a08b1..c49613eb33c 100644 --- a/src/test/ui/issues/issue-17718-patterns.stderr +++ b/src/test/ui/issues/issue-17718-patterns.stderr @@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics --> $DIR/issue-17718-patterns.rs:17:9 | LL | static A1: usize = 1; - | --------------------- a static `A1` is defined here + | --------------------- the static `A1` is defined here ... LL | A1 => {} //~ ERROR: match bindings cannot shadow statics | ^^ cannot be named the same as a static @@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow statics --> $DIR/issue-17718-patterns.rs:18:9 | LL | static mut A2: usize = 1; - | ------------------------- a static `A2` is defined here + | ------------------------- the static `A2` is defined here ... LL | A2 => {} //~ ERROR: match bindings cannot shadow statics | ^^ cannot be named the same as a static diff --git a/src/test/ui/issues/issue-23716.stderr b/src/test/ui/issues/issue-23716.stderr index fd268c1b5a1..c175f197034 100644 --- a/src/test/ui/issues/issue-23716.stderr +++ b/src/test/ui/issues/issue-23716.stderr @@ -2,7 +2,7 @@ error[E0530]: function parameters cannot shadow statics --> $DIR/issue-23716.rs:13:8 | LL | static foo: i32 = 0; - | -------------------- a static `foo` is defined here + | -------------------- the static `foo` is defined here LL | LL | fn bar(foo: i32) {} | ^^^ cannot be named the same as a static @@ -11,7 +11,7 @@ error[E0530]: function parameters cannot shadow statics --> $DIR/issue-23716.rs:23:13 | LL | use self::submod::answer; - | -------------------- a static `answer` is imported here + | -------------------- the static `answer` is imported here LL | LL | fn question(answer: i32) {} | ^^^^^^ cannot be named the same as a static diff --git a/src/test/ui/issues/issue-27033.stderr b/src/test/ui/issues/issue-27033.stderr index ba573c3eb6d..dfd635d36e8 100644 --- a/src/test/ui/issues/issue-27033.stderr +++ b/src/test/ui/issues/issue-27033.stderr @@ -8,7 +8,7 @@ error[E0530]: match bindings cannot shadow constants --> $DIR/issue-27033.rs:17:9 | LL | const C: u8 = 1; - | ---------------- a constant `C` is defined here + | ---------------- the constant `C` is defined here LL | match 1 { LL | C @ 2 => { //~ ERROR match bindings cannot shadow constant | ^ cannot be named the same as a constant diff --git a/src/test/ui/issues/issue-30560.rs b/src/test/ui/issues/issue-30560.rs index 0b1afd75ca9..f033666220d 100644 --- a/src/test/ui/issues/issue-30560.rs +++ b/src/test/ui/issues/issue-30560.rs @@ -11,10 +11,10 @@ type Alias = (); use Alias::*; //~^ ERROR unresolved import `Alias` [E0432] -//~| Not a module `Alias` +//~| not a module `Alias` use std::io::Result::*; //~^ ERROR unresolved import `std::io::Result` [E0432] -//~| Not a module `Result` +//~| not a module `Result` trait T {} use T::*; //~ ERROR items in traits are not importable diff --git a/src/test/ui/issues/issue-30560.stderr b/src/test/ui/issues/issue-30560.stderr index cb38c0dabe0..880c565cf9f 100644 --- a/src/test/ui/issues/issue-30560.stderr +++ b/src/test/ui/issues/issue-30560.stderr @@ -8,13 +8,13 @@ error[E0432]: unresolved import `Alias` --> $DIR/issue-30560.rs:12:5 | LL | use Alias::*; - | ^^^^^ Not a module `Alias` + | ^^^^^ not a module `Alias` error[E0432]: unresolved import `std::io::Result` --> $DIR/issue-30560.rs:15:14 | LL | use std::io::Result::*; - | ^^^^^^ Not a module `Result` + | ^^^^^^ not a module `Result` error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-33293.rs b/src/test/ui/issues/issue-33293.rs index bed577b8b9d..801ba7afcd6 100644 --- a/src/test/ui/issues/issue-33293.rs +++ b/src/test/ui/issues/issue-33293.rs @@ -11,6 +11,6 @@ fn main() { match 0 { aaa::bbb(_) => () - //~^ ERROR failed to resolve. Use of undeclared type or module `aaa` + //~^ ERROR failed to resolve: use of undeclared type or module `aaa` }; } diff --git a/src/test/ui/issues/issue-33293.stderr b/src/test/ui/issues/issue-33293.stderr index e94979b6da4..dc288fa71ce 100644 --- a/src/test/ui/issues/issue-33293.stderr +++ b/src/test/ui/issues/issue-33293.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `aaa` +error[E0433]: failed to resolve: use of undeclared type or module `aaa` --> $DIR/issue-33293.rs:13:9 | LL | aaa::bbb(_) => () - | ^^^ Use of undeclared type or module `aaa` + | ^^^ use of undeclared type or module `aaa` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-33464.stderr b/src/test/ui/issues/issue-33464.stderr index b70fff01c9e..f41a3973625 100644 --- a/src/test/ui/issues/issue-33464.stderr +++ b/src/test/ui/issues/issue-33464.stderr @@ -2,19 +2,19 @@ error[E0432]: unresolved import `abc` --> $DIR/issue-33464.rs:13:5 | LL | use abc::one_el; - | ^^^ Maybe a missing `extern crate abc;`? + | ^^^ maybe a missing `extern crate abc;`? error[E0432]: unresolved import `abc` --> $DIR/issue-33464.rs:15:5 | LL | use abc::{a, bbb, cccccc}; - | ^^^ Maybe a missing `extern crate abc;`? + | ^^^ maybe a missing `extern crate abc;`? error[E0432]: unresolved import `a_very_long_name` --> $DIR/issue-33464.rs:17:5 | LL | use a_very_long_name::{el, el2}; - | ^^^^^^^^^^^^^^^^ Maybe a missing `extern crate a_very_long_name;`? + | ^^^^^^^^^^^^^^^^ maybe a missing `extern crate a_very_long_name;`? error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-34047.stderr b/src/test/ui/issues/issue-34047.stderr index 10804cc6fff..10e4e9c1c12 100644 --- a/src/test/ui/issues/issue-34047.stderr +++ b/src/test/ui/issues/issue-34047.stderr @@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow constants --> $DIR/issue-34047.rs:15:13 | LL | const C: u8 = 0; - | ---------------- a constant `C` is defined here + | ---------------- the constant `C` is defined here ... LL | mut C => {} //~ ERROR match bindings cannot shadow constants | ^ cannot be named the same as a constant diff --git a/src/test/ui/issues/issue-36881.stderr b/src/test/ui/issues/issue-36881.stderr index 39132fde762..27effe9e342 100644 --- a/src/test/ui/issues/issue-36881.stderr +++ b/src/test/ui/issues/issue-36881.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `issue_36881_aux` --> $DIR/issue-36881.rs:16:9 | LL | use issue_36881_aux::Foo; //~ ERROR unresolved import - | ^^^^^^^^^^^^^^^ Maybe a missing `extern crate issue_36881_aux;`? + | ^^^^^^^^^^^^^^^ maybe a missing `extern crate issue_36881_aux;`? error: aborting due to previous error diff --git a/src/test/ui/issues/issue-37887.stderr b/src/test/ui/issues/issue-37887.stderr index 8448466087d..48fb6c2e6fa 100644 --- a/src/test/ui/issues/issue-37887.stderr +++ b/src/test/ui/issues/issue-37887.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `libc` --> $DIR/issue-37887.rs:13:9 | LL | use libc::*; //~ ERROR unresolved import - | ^^^^ Maybe a missing `extern crate libc;`? + | ^^^^ maybe a missing `extern crate libc;`? error[E0658]: use of unstable library feature 'libc': use `libc` from crates.io (see issue #27783) --> $DIR/issue-37887.rs:12:5 diff --git a/src/test/ui/issues/issue-38857.rs b/src/test/ui/issues/issue-38857.rs index b38b1b9fdc6..5217ddb9acb 100644 --- a/src/test/ui/issues/issue-38857.rs +++ b/src/test/ui/issues/issue-38857.rs @@ -10,6 +10,6 @@ fn main() { let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; - //~^ ERROR failed to resolve. Could not find `imp` in `sys` [E0433] + //~^ ERROR failed to resolve: could not find `imp` in `sys` [E0433] //~^^ ERROR module `sys` is private [E0603] } diff --git a/src/test/ui/issues/issue-38857.stderr b/src/test/ui/issues/issue-38857.stderr index f6ed3202671..65026344feb 100644 --- a/src/test/ui/issues/issue-38857.stderr +++ b/src/test/ui/issues/issue-38857.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Could not find `imp` in `sys` +error[E0433]: failed to resolve: could not find `imp` in `sys` --> $DIR/issue-38857.rs:12:23 | LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; - | ^^^ Could not find `imp` in `sys` + | ^^^ could not find `imp` in `sys` error[E0603]: module `sys` is private --> $DIR/issue-38857.rs:12:18 diff --git a/src/test/ui/keyword/keyword-super-as-identifier.rs b/src/test/ui/keyword/keyword-super-as-identifier.rs index 54dac771f01..d8941f3e532 100644 --- a/src/test/ui/keyword/keyword-super-as-identifier.rs +++ b/src/test/ui/keyword/keyword-super-as-identifier.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - let super = 22; //~ ERROR failed to resolve. There are too many initial `super`s + let super = 22; //~ ERROR failed to resolve: there are too many initial `super`s } diff --git a/src/test/ui/keyword/keyword-super-as-identifier.stderr b/src/test/ui/keyword/keyword-super-as-identifier.stderr index 649be45c224..9b665748794 100644 --- a/src/test/ui/keyword/keyword-super-as-identifier.stderr +++ b/src/test/ui/keyword/keyword-super-as-identifier.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. There are too many initial `super`s. +error[E0433]: failed to resolve: there are too many initial `super`s. --> $DIR/keyword-super-as-identifier.rs:12:9 | -LL | let super = 22; //~ ERROR failed to resolve. There are too many initial `super`s - | ^^^^^ There are too many initial `super`s. +LL | let super = 22; //~ ERROR failed to resolve: there are too many initial `super`s + | ^^^^^ there are too many initial `super`s. error: aborting due to previous error diff --git a/src/test/ui/keyword/keyword-super.rs b/src/test/ui/keyword/keyword-super.rs index 02047bd639f..87640630818 100644 --- a/src/test/ui/keyword/keyword-super.rs +++ b/src/test/ui/keyword/keyword-super.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - let super: isize; //~ ERROR failed to resolve. There are too many initial `super`s + let super: isize; //~ ERROR failed to resolve: there are too many initial `super`s } diff --git a/src/test/ui/keyword/keyword-super.stderr b/src/test/ui/keyword/keyword-super.stderr index ac692ad45d2..690b684c133 100644 --- a/src/test/ui/keyword/keyword-super.stderr +++ b/src/test/ui/keyword/keyword-super.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. There are too many initial `super`s. +error[E0433]: failed to resolve: there are too many initial `super`s. --> $DIR/keyword-super.rs:12:9 | -LL | let super: isize; //~ ERROR failed to resolve. There are too many initial `super`s - | ^^^^^ There are too many initial `super`s. +LL | let super: isize; //~ ERROR failed to resolve: there are too many initial `super`s + | ^^^^^ there are too many initial `super`s. error: aborting due to previous error diff --git a/src/test/ui/macros/ambiguity-legacy-vs-modern.stderr b/src/test/ui/macros/ambiguity-legacy-vs-modern.stderr index b5e1e751737..2785594585d 100644 --- a/src/test/ui/macros/ambiguity-legacy-vs-modern.stderr +++ b/src/test/ui/macros/ambiguity-legacy-vs-modern.stderr @@ -1,32 +1,32 @@ -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (`macro_rules` vs non-`macro_rules` from other module) --> $DIR/ambiguity-legacy-vs-modern.rs:31:9 | LL | m!() //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/ambiguity-legacy-vs-modern.rs:26:5 | LL | macro_rules! m { () => (()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/ambiguity-legacy-vs-modern.rs:29:9 | LL | macro m() { 0 } | ^^^^^^^^^^^^^^^ -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (`macro_rules` vs non-`macro_rules` from other module) --> $DIR/ambiguity-legacy-vs-modern.rs:43:5 | LL | m!() //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/ambiguity-legacy-vs-modern.rs:40:9 | LL | macro_rules! m { () => (()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/ambiguity-legacy-vs-modern.rs:36:5 | LL | macro m() { 0 } diff --git a/src/test/ui/macros/macro-inner-attributes.rs b/src/test/ui/macros/macro-inner-attributes.rs index 1111b21d455..2a58fd55453 100644 --- a/src/test/ui/macros/macro-inner-attributes.rs +++ b/src/test/ui/macros/macro-inner-attributes.rs @@ -25,6 +25,6 @@ test!(b, #[qux] fn main() { a::bar(); - //~^ ERROR failed to resolve. Use of undeclared type or module `a` + //~^ ERROR failed to resolve: use of undeclared type or module `a` b::bar(); } diff --git a/src/test/ui/macros/macro-inner-attributes.stderr b/src/test/ui/macros/macro-inner-attributes.stderr index 11922bc448b..47d9469779b 100644 --- a/src/test/ui/macros/macro-inner-attributes.stderr +++ b/src/test/ui/macros/macro-inner-attributes.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `a` +error[E0433]: failed to resolve: use of undeclared type or module `a` --> $DIR/macro-inner-attributes.rs:27:5 | LL | a::bar(); - | ^ Use of undeclared type or module `a` + | ^ use of undeclared type or module `a` error: aborting due to previous error diff --git a/src/test/ui/macros/macro-path-prelude-fail-1.rs b/src/test/ui/macros/macro-path-prelude-fail-1.rs index e1181eb741b..bdf3ac0f69f 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-1.rs +++ b/src/test/ui/macros/macro-path-prelude-fail-1.rs @@ -12,8 +12,8 @@ mod m { fn check() { - Vec::clone!(); //~ ERROR failed to resolve. Not a module `Vec` - u8::clone!(); //~ ERROR failed to resolve. Not a module `u8` + Vec::clone!(); //~ ERROR failed to resolve: not a module `Vec` + u8::clone!(); //~ ERROR failed to resolve: not a module `u8` } } diff --git a/src/test/ui/macros/macro-path-prelude-fail-1.stderr b/src/test/ui/macros/macro-path-prelude-fail-1.stderr index fc74937d912..590e4f0fd06 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-1.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-1.stderr @@ -1,14 +1,14 @@ -error[E0433]: failed to resolve. Not a module `Vec` +error[E0433]: failed to resolve: not a module `Vec` --> $DIR/macro-path-prelude-fail-1.rs:15:9 | -LL | Vec::clone!(); //~ ERROR failed to resolve. Not a module `Vec` - | ^^^ Not a module `Vec` +LL | Vec::clone!(); //~ ERROR failed to resolve: not a module `Vec` + | ^^^ not a module `Vec` -error[E0433]: failed to resolve. Not a module `u8` +error[E0433]: failed to resolve: not a module `u8` --> $DIR/macro-path-prelude-fail-1.rs:16:9 | -LL | u8::clone!(); //~ ERROR failed to resolve. Not a module `u8` - | ^^ Not a module `u8` +LL | u8::clone!(); //~ ERROR failed to resolve: not a module `u8` + | ^^ not a module `u8` error: aborting due to 2 previous errors diff --git a/src/test/ui/macros/macro-path-prelude-fail-2.rs b/src/test/ui/macros/macro-path-prelude-fail-2.rs index 82258dac37b..e27c061e195 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-2.rs +++ b/src/test/ui/macros/macro-path-prelude-fail-2.rs @@ -10,7 +10,7 @@ mod m { fn check() { - Result::Ok!(); //~ ERROR fail to resolve non-ident macro path + Result::Ok!(); //~ ERROR failed to resolve: partially resolved path in a macro } } diff --git a/src/test/ui/macros/macro-path-prelude-fail-2.stderr b/src/test/ui/macros/macro-path-prelude-fail-2.stderr index 876ee2584e9..cf123f43fea 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-2.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-2.stderr @@ -1,8 +1,9 @@ -error: fail to resolve non-ident macro path +error[E0433]: failed to resolve: partially resolved path in a macro --> $DIR/macro-path-prelude-fail-2.rs:13:9 | -LL | Result::Ok!(); //~ ERROR fail to resolve non-ident macro path - | ^^^^^^^^^^ +LL | Result::Ok!(); //~ ERROR failed to resolve: partially resolved path in a macro + | ^^^^^^^^^^ partially resolved path in a macro error: aborting due to previous error +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/macros/macro-path-prelude-shadowing.stderr b/src/test/ui/macros/macro-path-prelude-shadowing.stderr index 688b9dc2797..904eed9f249 100644 --- a/src/test/ui/macros/macro-path-prelude-shadowing.stderr +++ b/src/test/ui/macros/macro-path-prelude-shadowing.stderr @@ -1,16 +1,17 @@ -error[E0659]: `std` is ambiguous +error[E0659]: `std` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) --> $DIR/macro-path-prelude-shadowing.rs:39:9 | LL | std::panic!(); //~ ERROR `std` is ambiguous | ^^^ ambiguous name | -note: `std` could refer to the name imported here + = note: `std` could refer to a built-in extern crate +note: `std` could also refer to the module imported here --> $DIR/macro-path-prelude-shadowing.rs:37:9 | LL | use m2::*; // glob-import user-defined `std` | ^^^^^ -note: `std` could also refer to the name defined here - = note: consider adding an explicit import of `std` to disambiguate + = help: consider adding an explicit import of `std` to disambiguate + = help: or use `self::std` to refer to this module unambiguously error: aborting due to previous error diff --git a/src/test/ui/macros/macro-shadowing.stderr b/src/test/ui/macros/macro-shadowing.stderr index d996f3a7041..6985dfcc6c2 100644 --- a/src/test/ui/macros/macro-shadowing.stderr +++ b/src/test/ui/macros/macro-shadowing.stderr @@ -9,13 +9,13 @@ LL | m1!(); | = note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560) -error[E0659]: `foo` is ambiguous +error[E0659]: `foo` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/macro-shadowing.rs:27:1 | LL | foo!(); //~ ERROR `foo` is ambiguous | ^^^ ambiguous name | -note: `foo` could refer to the name defined here +note: `foo` could refer to the macro defined here --> $DIR/macro-shadowing.rs:20:5 | LL | macro_rules! foo { () => {} } @@ -23,12 +23,11 @@ LL | macro_rules! foo { () => {} } ... LL | m1!(); | ------ in this macro invocation -note: `foo` could also refer to the name defined here +note: `foo` could also refer to the macro defined here --> $DIR/macro-shadowing.rs:15:1 | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: macro-expanded macros do not shadow error: aborting due to 2 previous errors diff --git a/src/test/ui/macros/macro_path_as_generic_bound.stderr b/src/test/ui/macros/macro_path_as_generic_bound.stderr index 0f9f0607c5b..8b4fe9f200d 100644 --- a/src/test/ui/macros/macro_path_as_generic_bound.stderr +++ b/src/test/ui/macros/macro_path_as_generic_bound.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `m` +error[E0433]: failed to resolve: use of undeclared type or module `m` --> $DIR/macro_path_as_generic_bound.rs:17:6 | LL | foo!(m::m2::A); //~ ERROR failed to resolve - | ^ Use of undeclared type or module `m` + | ^ use of undeclared type or module `m` error: aborting due to previous error diff --git a/src/test/ui/macros/restricted-shadowing-legacy.stderr b/src/test/ui/macros/restricted-shadowing-legacy.stderr index 9e0d40c44b6..2135d63c80e 100644 --- a/src/test/ui/macros/restricted-shadowing-legacy.stderr +++ b/src/test/ui/macros/restricted-shadowing-legacy.stderr @@ -1,10 +1,10 @@ -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:101:13 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -12,7 +12,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:97:9 | LL | macro_rules! m { () => {} } @@ -20,15 +20,14 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:139:42 | LL | macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -36,7 +35,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:135:9 | LL | macro_rules! m { () => {} } @@ -44,15 +43,14 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:148:9 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -60,7 +58,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:144:9 | LL | macro_rules! m { () => {} } @@ -68,15 +66,14 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:164:9 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -84,7 +81,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:85:9 | LL | macro_rules! m { () => { Wrong } } @@ -92,15 +89,14 @@ LL | macro_rules! m { () => { Wrong } } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:180:13 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -108,7 +104,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:85:9 | LL | macro_rules! m { () => { Wrong } } @@ -116,15 +112,14 @@ LL | macro_rules! m { () => { Wrong } } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:218:42 | LL | macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -132,7 +127,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:85:9 | LL | macro_rules! m { () => { Wrong } } @@ -140,15 +135,14 @@ LL | macro_rules! m { () => { Wrong } } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:232:9 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -156,7 +150,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:227:13 | LL | macro_rules! m { () => {} } @@ -164,15 +158,14 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:262:42 | LL | macro_rules! gen_invoc { () => { m!() } } //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:88:9 | LL | macro_rules! m { () => { Right } } @@ -180,7 +173,7 @@ LL | macro_rules! m { () => { Right } } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-legacy.rs:257:13 | LL | macro_rules! m { () => {} } @@ -188,7 +181,6 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow error: aborting due to 8 previous errors diff --git a/src/test/ui/macros/restricted-shadowing-modern.stderr b/src/test/ui/macros/restricted-shadowing-modern.stderr index 0462438be78..2449e8512d3 100644 --- a/src/test/ui/macros/restricted-shadowing-modern.stderr +++ b/src/test/ui/macros/restricted-shadowing-modern.stderr @@ -1,10 +1,10 @@ -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:106:17 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:91:9 | LL | macro m() { Right } @@ -12,7 +12,7 @@ LL | macro m() { Right } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:101:9 | LL | macro m() {} @@ -20,15 +20,14 @@ LL | macro m() {} ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:149:33 | LL | macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:91:9 | LL | macro m() { Right } @@ -36,7 +35,7 @@ LL | macro m() { Right } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:145:9 | LL | macro m() {} @@ -44,15 +43,14 @@ LL | macro m() {} ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:158:13 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:91:9 | LL | macro m() { Right } @@ -60,7 +58,7 @@ LL | macro m() { Right } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:155:9 | LL | macro m() {} @@ -68,15 +66,14 @@ LL | macro m() {} ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:174:13 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:91:9 | LL | macro m() { Right } @@ -84,7 +81,7 @@ LL | macro m() { Right } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:87:9 | LL | macro m() { Wrong } @@ -92,15 +89,14 @@ LL | macro m() { Wrong } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:192:17 | LL | m!(); //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:91:9 | LL | macro m() { Right } @@ -108,7 +104,7 @@ LL | macro m() { Right } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:87:9 | LL | macro m() { Wrong } @@ -116,15 +112,14 @@ LL | macro m() { Wrong } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow -error[E0659]: `m` is ambiguous +error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:235:33 | LL | macro gen_invoc() { m!() } //~ ERROR `m` is ambiguous | ^ ambiguous name | -note: `m` could refer to the name defined here +note: `m` could refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:91:9 | LL | macro m() { Right } @@ -132,7 +127,7 @@ LL | macro m() { Right } ... LL | include!(); | ----------- in this macro invocation -note: `m` could also refer to the name defined here +note: `m` could also refer to the macro defined here --> $DIR/restricted-shadowing-modern.rs:87:9 | LL | macro m() { Wrong } @@ -140,7 +135,6 @@ LL | macro m() { Wrong } ... LL | include!(); | ----------- in this macro invocation - = note: macro-expanded macros do not shadow error: aborting due to 6 previous errors diff --git a/src/test/ui/out-of-order-shadowing.stderr b/src/test/ui/out-of-order-shadowing.stderr index d96a802cb3f..4696e205728 100644 --- a/src/test/ui/out-of-order-shadowing.stderr +++ b/src/test/ui/out-of-order-shadowing.stderr @@ -1,20 +1,19 @@ -error[E0659]: `bar` is ambiguous +error[E0659]: `bar` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/out-of-order-shadowing.rs:15:1 | LL | bar!(); //~ ERROR `bar` is ambiguous | ^^^ ambiguous name | -note: `bar` could refer to the name defined here +note: `bar` could refer to the macro defined here --> $DIR/out-of-order-shadowing.rs:14:1 | LL | define_macro!(bar); | ^^^^^^^^^^^^^^^^^^^ -note: `bar` could also refer to the name defined here +note: `bar` could also refer to the macro defined here --> $DIR/out-of-order-shadowing.rs:13:1 | LL | macro_rules! bar { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: macro-expanded macros do not shadow = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr b/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr index 9dd6a318e98..994c78d575e 100644 --- a/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr +++ b/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr @@ -2,7 +2,7 @@ error[E0530]: let bindings cannot shadow tuple structs --> $DIR/pat-shadow-in-nested-binding.rs:14:10 | LL | struct foo(usize); - | ------------------ a tuple struct `foo` is defined here + | ------------------ the tuple struct `foo` is defined here ... LL | let (foo, _) = (2, 3); //~ ERROR let bindings cannot shadow tuple structs | ^^^ cannot be named the same as a tuple struct diff --git a/src/test/ui/pattern/pattern-binding-disambiguation.stderr b/src/test/ui/pattern/pattern-binding-disambiguation.stderr index 7acdb07e10d..5d14610b8a1 100644 --- a/src/test/ui/pattern/pattern-binding-disambiguation.stderr +++ b/src/test/ui/pattern/pattern-binding-disambiguation.stderr @@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow tuple structs --> $DIR/pattern-binding-disambiguation.rs:34:9 | LL | struct TupleStruct(); - | --------------------- a tuple struct `TupleStruct` is defined here + | --------------------- the tuple struct `TupleStruct` is defined here ... LL | TupleStruct => {} //~ ERROR match bindings cannot shadow tuple structs | ^^^^^^^^^^^ cannot be named the same as a tuple struct @@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow tuple variants --> $DIR/pattern-binding-disambiguation.rs:43:9 | LL | use E::*; - | ---- a tuple variant `TupleVariant` is imported here + | ---- the tuple variant `TupleVariant` is imported here ... LL | TupleVariant => {} //~ ERROR match bindings cannot shadow tuple variants | ^^^^^^^^^^^^ cannot be named the same as a tuple variant @@ -20,7 +20,7 @@ error[E0530]: match bindings cannot shadow struct variants --> $DIR/pattern-binding-disambiguation.rs:46:9 | LL | use E::*; - | ---- a struct variant `BracedVariant` is imported here + | ---- the struct variant `BracedVariant` is imported here ... LL | BracedVariant => {} //~ ERROR match bindings cannot shadow struct variants | ^^^^^^^^^^^^^ cannot be named the same as a struct variant @@ -29,7 +29,7 @@ error[E0530]: match bindings cannot shadow statics --> $DIR/pattern-binding-disambiguation.rs:52:9 | LL | static STATIC: () = (); - | ----------------------- a static `STATIC` is defined here + | ----------------------- the static `STATIC` is defined here ... LL | STATIC => {} //~ ERROR match bindings cannot shadow statics | ^^^^^^ cannot be named the same as a static @@ -38,7 +38,7 @@ error[E0530]: let bindings cannot shadow tuple structs --> $DIR/pattern-binding-disambiguation.rs:59:9 | LL | struct TupleStruct(); - | --------------------- a tuple struct `TupleStruct` is defined here + | --------------------- the tuple struct `TupleStruct` is defined here ... LL | let TupleStruct = doesnt_matter; //~ ERROR let bindings cannot shadow tuple structs | ^^^^^^^^^^^ cannot be named the same as a tuple struct @@ -47,7 +47,7 @@ error[E0530]: let bindings cannot shadow tuple variants --> $DIR/pattern-binding-disambiguation.rs:62:9 | LL | use E::*; - | ---- a tuple variant `TupleVariant` is imported here + | ---- the tuple variant `TupleVariant` is imported here ... LL | let TupleVariant = doesnt_matter; //~ ERROR let bindings cannot shadow tuple variants | ^^^^^^^^^^^^ cannot be named the same as a tuple variant @@ -56,7 +56,7 @@ error[E0530]: let bindings cannot shadow struct variants --> $DIR/pattern-binding-disambiguation.rs:63:9 | LL | use E::*; - | ---- a struct variant `BracedVariant` is imported here + | ---- the struct variant `BracedVariant` is imported here ... LL | let BracedVariant = doesnt_matter; //~ ERROR let bindings cannot shadow struct variants | ^^^^^^^^^^^^^ cannot be named the same as a struct variant @@ -65,7 +65,7 @@ error[E0530]: let bindings cannot shadow statics --> $DIR/pattern-binding-disambiguation.rs:65:9 | LL | static STATIC: () = (); - | ----------------------- a static `STATIC` is defined here + | ----------------------- the static `STATIC` is defined here ... LL | let STATIC = doesnt_matter; //~ ERROR let bindings cannot shadow statics | ^^^^^^ cannot be named the same as a static diff --git a/src/test/ui/pattern/pattern-error-continue.rs b/src/test/ui/pattern/pattern-error-continue.rs index e63b84594aa..c544ca4e304 100644 --- a/src/test/ui/pattern/pattern-error-continue.rs +++ b/src/test/ui/pattern/pattern-error-continue.rs @@ -42,6 +42,6 @@ fn main() { //~| expected char, found bool match () { - E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E` + E::V => {} //~ ERROR failed to resolve: use of undeclared type or module `E` } } diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr index b24366c48bc..f2c35ef872d 100644 --- a/src/test/ui/pattern/pattern-error-continue.stderr +++ b/src/test/ui/pattern/pattern-error-continue.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `E` +error[E0433]: failed to resolve: use of undeclared type or module `E` --> $DIR/pattern-error-continue.rs:45:9 | -LL | E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E` - | ^ Use of undeclared type or module `E` +LL | E::V => {} //~ ERROR failed to resolve: use of undeclared type or module `E` + | ^ use of undeclared type or module `E` error[E0532]: expected tuple struct/variant, found unit variant `A::D` --> $DIR/pattern-error-continue.rs:28:9 diff --git a/src/test/ui/privacy/decl-macro.rs b/src/test/ui/privacy/decl-macro.rs new file mode 100644 index 00000000000..1eb49bd5301 --- /dev/null +++ b/src/test/ui/privacy/decl-macro.rs @@ -0,0 +1,9 @@ +#![feature(decl_macro)] + +mod m { + macro mac() {} +} + +fn main() { + m::mac!(); //~ ERROR macro `mac` is private +} diff --git a/src/test/ui/privacy/decl-macro.stderr b/src/test/ui/privacy/decl-macro.stderr new file mode 100644 index 00000000000..c8b043d1b5f --- /dev/null +++ b/src/test/ui/privacy/decl-macro.stderr @@ -0,0 +1,9 @@ +error[E0603]: macro `mac` is private + --> $DIR/decl-macro.rs:8:8 + | +LL | m::mac!(); //~ ERROR macro `mac` is private + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/privacy/restricted/test.rs b/src/test/ui/privacy/restricted/test.rs index 8c1d609e244..2b2d9b76bdd 100644 --- a/src/test/ui/privacy/restricted/test.rs +++ b/src/test/ui/privacy/restricted/test.rs @@ -57,6 +57,6 @@ fn main() { } mod pathological { - pub(in bad::path) mod m1 {} //~ ERROR failed to resolve. Maybe a missing `extern crate bad;`? + pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing `extern crate bad;`? pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules } diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr index afc3ee2db4b..01e224910a5 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/src/test/ui/privacy/restricted/test.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Maybe a missing `extern crate bad;`? +error[E0433]: failed to resolve: maybe a missing `extern crate bad;`? --> $DIR/test.rs:60:12 | -LL | pub(in bad::path) mod m1 {} //~ ERROR failed to resolve. Maybe a missing `extern crate bad;`? - | ^^^ Maybe a missing `extern crate bad;`? +LL | pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: maybe a missing `extern crate bad;`? + | ^^^ maybe a missing `extern crate bad;`? error: visibilities can only be restricted to ancestor modules --> $DIR/test.rs:61:12 diff --git a/src/test/ui/resolve/resolve-variant-assoc-item.rs b/src/test/ui/resolve/resolve-variant-assoc-item.rs index 869eed5a8d7..01f493e954b 100644 --- a/src/test/ui/resolve/resolve-variant-assoc-item.rs +++ b/src/test/ui/resolve/resolve-variant-assoc-item.rs @@ -12,6 +12,6 @@ enum E { V } use E::V; fn main() { - E::V::associated_item; //~ ERROR failed to resolve. Not a module `V` - V::associated_item; //~ ERROR failed to resolve. Not a module `V` + E::V::associated_item; //~ ERROR failed to resolve: not a module `V` + V::associated_item; //~ ERROR failed to resolve: not a module `V` } diff --git a/src/test/ui/resolve/resolve-variant-assoc-item.stderr b/src/test/ui/resolve/resolve-variant-assoc-item.stderr index a80a7c39249..ef2d0a71b5b 100644 --- a/src/test/ui/resolve/resolve-variant-assoc-item.stderr +++ b/src/test/ui/resolve/resolve-variant-assoc-item.stderr @@ -1,14 +1,14 @@ -error[E0433]: failed to resolve. Not a module `V` +error[E0433]: failed to resolve: not a module `V` --> $DIR/resolve-variant-assoc-item.rs:15:8 | -LL | E::V::associated_item; //~ ERROR failed to resolve. Not a module `V` - | ^ Not a module `V` +LL | E::V::associated_item; //~ ERROR failed to resolve: not a module `V` + | ^ not a module `V` -error[E0433]: failed to resolve. Not a module `V` +error[E0433]: failed to resolve: not a module `V` --> $DIR/resolve-variant-assoc-item.rs:16:5 | -LL | V::associated_item; //~ ERROR failed to resolve. Not a module `V` - | ^ Not a module `V` +LL | V::associated_item; //~ ERROR failed to resolve: not a module `V` + | ^ not a module `V` error: aborting due to 2 previous errors diff --git a/src/test/ui/resolve_self_super_hint.rs b/src/test/ui/resolve_self_super_hint.rs index a30e73cf02d..2ce2d765832 100644 --- a/src/test/ui/resolve_self_super_hint.rs +++ b/src/test/ui/resolve_self_super_hint.rs @@ -15,19 +15,19 @@ mod a { extern crate alloc; use alloc::HashMap; //~^ ERROR unresolved import `alloc` [E0432] - //~| Did you mean `self::alloc`? + //~| did you mean `self::alloc`? mod b { use alloc::HashMap; //~^ ERROR unresolved import `alloc` [E0432] - //~| Did you mean `super::alloc`? + //~| did you mean `super::alloc`? mod c { use alloc::HashMap; //~^ ERROR unresolved import `alloc` [E0432] - //~| Did you mean `std::alloc`? + //~| did you mean `a::alloc`? mod d { use alloc::HashMap; //~^ ERROR unresolved import `alloc` [E0432] - //~| Did you mean `std::alloc`? + //~| did you mean `a::alloc`? } } } diff --git a/src/test/ui/resolve_self_super_hint.stderr b/src/test/ui/resolve_self_super_hint.stderr index b58a23724e4..613107712b2 100644 --- a/src/test/ui/resolve_self_super_hint.stderr +++ b/src/test/ui/resolve_self_super_hint.stderr @@ -2,25 +2,25 @@ error[E0432]: unresolved import `alloc` --> $DIR/resolve_self_super_hint.rs:16:9 | LL | use alloc::HashMap; - | ^^^^^ Did you mean `self::alloc`? + | ^^^^^ did you mean `self::alloc`? error[E0432]: unresolved import `alloc` --> $DIR/resolve_self_super_hint.rs:20:13 | LL | use alloc::HashMap; - | ^^^^^ Did you mean `super::alloc`? + | ^^^^^ did you mean `super::alloc`? error[E0432]: unresolved import `alloc` --> $DIR/resolve_self_super_hint.rs:24:17 | LL | use alloc::HashMap; - | ^^^^^ Did you mean `std::alloc`? + | ^^^^^ did you mean `a::alloc`? error[E0432]: unresolved import `alloc` --> $DIR/resolve_self_super_hint.rs:28:21 | LL | use alloc::HashMap; - | ^^^^^ Did you mean `std::alloc`? + | ^^^^^ did you mean `a::alloc`? error: aborting due to 4 previous errors diff --git a/src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr b/src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr index f16c8496077..2751d8cb285 100644 --- a/src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr +++ b/src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve. `crate` in paths can only be used in start position +error[E0433]: failed to resolve: `crate` in paths can only be used in start position --> $DIR/crate-path-non-absolute.rs:17:22 | LL | let s = ::m::crate::S; //~ ERROR failed to resolve | ^^^^^ `crate` in paths can only be used in start position -error[E0433]: failed to resolve. global paths cannot start with `crate` +error[E0433]: failed to resolve: global paths cannot start with `crate` --> $DIR/crate-path-non-absolute.rs:18:20 | LL | let s1 = ::crate::S; //~ ERROR failed to resolve diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr index 1a8ceec5dac..39b2db7a19f 100644 --- a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr +++ b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `xcrate` --> $DIR/non-existent-1.rs:13:5 | LL | use xcrate::S; //~ ERROR unresolved import `xcrate` - | ^^^^^^ Could not find `xcrate` in `{{root}}` + | ^^^^^^ use of undeclared type or module `xcrate` error: aborting due to previous error diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs index 41adb974f21..a07c3f17d6f 100644 --- a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs +++ b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs @@ -12,5 +12,5 @@ fn main() { let s = ::xcrate::S; - //~^ ERROR failed to resolve. Could not find `xcrate` in `{{root}}` + //~^ ERROR failed to resolve: could not find `xcrate` in `{{root}}` } diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr index b46576b0143..30e5b0ad1df 100644 --- a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr +++ b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Could not find `xcrate` in `{{root}}` +error[E0433]: failed to resolve: could not find `xcrate` in `{{root}}` --> $DIR/non-existent-2.rs:14:15 | LL | let s = ::xcrate::S; - | ^^^^^^ Could not find `xcrate` in `{{root}}` + | ^^^^^^ could not find `xcrate` in `{{root}}` error: aborting due to previous error diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.rs b/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.rs index f95961d2a9b..bfe7e4da845 100644 --- a/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.rs +++ b/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.rs @@ -10,10 +10,12 @@ // edition:2018 +#![feature(uniform_paths)] + // Tests that arbitrary crates (other than `core`, `std` and `meta`) // aren't allowed without `--extern`, even if they're in the sysroot. use alloc; //~ ERROR unresolved import `alloc` -use test; //~ ERROR unresolved import `test` -use proc_macro; //~ ERROR unresolved import `proc_macro` +use test; //~ ERROR cannot import a built-in macro +use proc_macro; // OK, imports the built-in `proc_macro` attribute, but not the `proc_macro` crate. fn main() {} diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.stderr index 0865bd6bea5..06c11b894dd 100644 --- a/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.stderr +++ b/src/test/ui/rfc-2126-extern-absolute-paths/not-whitelisted.stderr @@ -1,21 +1,15 @@ -error[E0432]: unresolved import `alloc` - --> $DIR/not-whitelisted.rs:15:5 - | -LL | use alloc; //~ ERROR unresolved import `alloc` - | ^^^^^ no `alloc` external crate - -error[E0432]: unresolved import `test` - --> $DIR/not-whitelisted.rs:16:5 +error: cannot import a built-in macro + --> $DIR/not-whitelisted.rs:18:5 | -LL | use test; //~ ERROR unresolved import `test` - | ^^^^ no `test` external crate +LL | use test; //~ ERROR cannot import a built-in macro + | ^^^^ -error[E0432]: unresolved import `proc_macro` +error[E0432]: unresolved import `alloc` --> $DIR/not-whitelisted.rs:17:5 | -LL | use proc_macro; //~ ERROR unresolved import `proc_macro` - | ^^^^^^^^^^ no `proc_macro` external crate +LL | use alloc; //~ ERROR unresolved import `alloc` + | ^^^^^ no `alloc` external crate -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr index 55b8b625507..47ea4b8dfcb 100644 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr +++ b/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `extern::xcrate` --> $DIR/non-existent-1.rs:13:13 | LL | use extern::xcrate::S; //~ ERROR unresolved import `extern::xcrate` - | ^^^^^^ Could not find `xcrate` in `extern` + | ^^^^^^ could not find `xcrate` in `extern` error: aborting due to previous error diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs b/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs index 128ecf41a30..8d7c3993c62 100644 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs +++ b/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs @@ -12,5 +12,5 @@ fn main() { let s = extern::xcrate::S; - //~^ ERROR failed to resolve. Could not find `xcrate` in `extern` + //~^ ERROR failed to resolve: could not find `xcrate` in `extern` } diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr index 7fbe50a9202..89630adb5a8 100644 --- a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr +++ b/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Could not find `xcrate` in `extern` +error[E0433]: failed to resolve: could not find `xcrate` in `extern` --> $DIR/non-existent-2.rs:14:21 | LL | let s = extern::xcrate::S; - | ^^^^^^ Could not find `xcrate` in `extern` + | ^^^^^^ could not find `xcrate` in `extern` error: aborting due to previous error diff --git a/src/test/ui/rust-2018/future-proofing-locals.rs b/src/test/ui/rust-2018/future-proofing-locals.rs new file mode 100644 index 00000000000..d2e6dbbb954 --- /dev/null +++ b/src/test/ui/rust-2018/future-proofing-locals.rs @@ -0,0 +1,49 @@ +// edition:2018 + +#![feature(uniform_paths, underscore_imports)] + +mod T { + pub struct U; +} +mod x { + pub struct y; +} + +fn type_param<T>() { + use T as _; //~ ERROR imports cannot refer to type parameters + use T::U; //~ ERROR imports cannot refer to type parameters + use T::*; //~ ERROR imports cannot refer to type parameters +} + +fn self_import<T>() { + use T; // FIXME Should be an error, but future-proofing fails due to `T` being "self-shadowed" +} + +fn let_binding() { + let x = 10; + + use x as _; //~ ERROR imports cannot refer to local variables + use x::y; // OK + use x::*; // OK +} + +fn param_binding(x: u8) { + use x; //~ ERROR imports cannot refer to local variables +} + +fn match_binding() { + match 0 { + x => { + use x; //~ ERROR imports cannot refer to local variables + } + } +} + +fn nested<T>() { + let x = 10; + + use {T as _, x}; //~ ERROR imports cannot refer to type parameters + //~| ERROR imports cannot refer to local variables +} + +fn main() {} diff --git a/src/test/ui/rust-2018/future-proofing-locals.stderr b/src/test/ui/rust-2018/future-proofing-locals.stderr new file mode 100644 index 00000000000..68354b332a9 --- /dev/null +++ b/src/test/ui/rust-2018/future-proofing-locals.stderr @@ -0,0 +1,50 @@ +error: imports cannot refer to type parameters + --> $DIR/future-proofing-locals.rs:13:9 + | +LL | use T as _; //~ ERROR imports cannot refer to type parameters + | ^ + +error: imports cannot refer to type parameters + --> $DIR/future-proofing-locals.rs:14:9 + | +LL | use T::U; //~ ERROR imports cannot refer to type parameters + | ^ + +error: imports cannot refer to type parameters + --> $DIR/future-proofing-locals.rs:15:9 + | +LL | use T::*; //~ ERROR imports cannot refer to type parameters + | ^ + +error: imports cannot refer to local variables + --> $DIR/future-proofing-locals.rs:25:9 + | +LL | use x as _; //~ ERROR imports cannot refer to local variables + | ^ + +error: imports cannot refer to local variables + --> $DIR/future-proofing-locals.rs:31:9 + | +LL | use x; //~ ERROR imports cannot refer to local variables + | ^ + +error: imports cannot refer to local variables + --> $DIR/future-proofing-locals.rs:37:17 + | +LL | use x; //~ ERROR imports cannot refer to local variables + | ^ + +error: imports cannot refer to type parameters + --> $DIR/future-proofing-locals.rs:45:10 + | +LL | use {T as _, x}; //~ ERROR imports cannot refer to type parameters + | ^ + +error: imports cannot refer to local variables + --> $DIR/future-proofing-locals.rs:45:18 + | +LL | use {T as _, x}; //~ ERROR imports cannot refer to type parameters + | ^ + +error: aborting due to 8 previous errors + diff --git a/src/test/ui/rust-2018/issue-54006.stderr b/src/test/ui/rust-2018/issue-54006.stderr index 268a16e5d2a..5f92574c23f 100644 --- a/src/test/ui/rust-2018/issue-54006.stderr +++ b/src/test/ui/rust-2018/issue-54006.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `alloc` --> $DIR/issue-54006.rs:16:5 | LL | use alloc::vec; - | ^^^^^ Did you mean `core::alloc`? + | ^^^^^ did you mean `core::alloc`? error: cannot determine resolution for the macro `vec` --> $DIR/issue-54006.rs:20:18 diff --git a/src/test/ui/rust-2018/local-path-suggestions-2015.stderr b/src/test/ui/rust-2018/local-path-suggestions-2015.stderr index d7580507ce4..741b2ca0826 100644 --- a/src/test/ui/rust-2018/local-path-suggestions-2015.stderr +++ b/src/test/ui/rust-2018/local-path-suggestions-2015.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `foobar` --> $DIR/local-path-suggestions-2015.rs:34:5 | LL | use foobar::Baz; - | ^^^^^^ Did you mean `aux_baz::foobar`? + | ^^^^^^ did you mean `aux_baz::foobar`? error: aborting due to previous error diff --git a/src/test/ui/rust-2018/local-path-suggestions-2018.rs b/src/test/ui/rust-2018/local-path-suggestions-2018.rs index 147dae401f6..0d4aefff931 100644 --- a/src/test/ui/rust-2018/local-path-suggestions-2018.rs +++ b/src/test/ui/rust-2018/local-path-suggestions-2018.rs @@ -12,12 +12,14 @@ // compile-flags:--extern baz // edition:2018 +#![feature(uniform_paths)] + mod foo { pub type Bar = u32; } -mod baz { - use foo::Bar; +mod bazz { + use foo::Bar; //~ ERROR unresolved import `foo` fn baz() { let x: Bar = 22; @@ -26,6 +28,6 @@ mod baz { use foo::Bar; -use foobar::Baz; +use foobar::Baz; //~ ERROR unresolved import `foobar` fn main() { } diff --git a/src/test/ui/rust-2018/local-path-suggestions-2018.stderr b/src/test/ui/rust-2018/local-path-suggestions-2018.stderr index 2293f4b0017..a445a4c612b 100644 --- a/src/test/ui/rust-2018/local-path-suggestions-2018.stderr +++ b/src/test/ui/rust-2018/local-path-suggestions-2018.stderr @@ -1,23 +1,17 @@ error[E0432]: unresolved import `foo` - --> $DIR/local-path-suggestions-2018.rs:20:9 + --> $DIR/local-path-suggestions-2018.rs:22:9 | -LL | use foo::Bar; - | ^^^ Did you mean `crate::foo`? +LL | use foo::Bar; //~ ERROR unresolved import `foo` + | ^^^ did you mean `crate::foo`? | = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html> -error[E0432]: unresolved import `foo` - --> $DIR/local-path-suggestions-2018.rs:27:5 - | -LL | use foo::Bar; - | ^^^ Did you mean `self::foo`? - error[E0432]: unresolved import `foobar` - --> $DIR/local-path-suggestions-2018.rs:29:5 + --> $DIR/local-path-suggestions-2018.rs:31:5 | -LL | use foobar::Baz; - | ^^^^^^ Did you mean `baz::foobar`? +LL | use foobar::Baz; //~ ERROR unresolved import `foobar` + | ^^^^^^ did you mean `baz::foobar`? -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.rs b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.rs index 590e83b0781..4819711115c 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.rs +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.rs @@ -14,7 +14,7 @@ mod foo { pub use std::io; - //~^ ERROR `std` import is ambiguous + //~^ ERROR `std` is ambiguous macro_rules! m { () => { diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.stderr b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.stderr index 948043cff76..204e0a7e141 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.stderr +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros-nested.stderr @@ -1,16 +1,23 @@ -error: `std` import is ambiguous +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity-macros-nested.rs:16:13 | -LL | pub use std::io; - | ^^^ can refer to external crate `::std` -... +LL | pub use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-macros-nested.rs:21:13 + | LL | / mod std { LL | | pub struct io; LL | | } - | |_____________- may refer to `self::std` in the future - | - = help: write `::std` or `self::std` explicitly instead - = note: in the future, `#![feature(uniform_paths)]` may become the default + | |_____________^ +... +LL | m!(); + | ----- in this macro invocation + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.rs b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.rs index 861efba14f8..148320de556 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.rs +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.rs @@ -13,7 +13,7 @@ // This test is similar to `ambiguity.rs`, but with macros defining local items. use std::io; -//~^ ERROR `std` import is ambiguous +//~^ ERROR `std` is ambiguous macro_rules! m { () => { diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.stderr b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.stderr index 40cceea2440..ac8d3b9d0cb 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.stderr +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-macros.stderr @@ -1,16 +1,23 @@ -error: `std` import is ambiguous +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity-macros.rs:15:5 | -LL | use std::io; - | ^^^ can refer to external crate `::std` -... +LL | use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-macros.rs:20:9 + | LL | / mod std { LL | | pub struct io; LL | | } - | |_________- may refer to `self::std` in the future - | - = help: write `::std` or `self::std` explicitly instead - = note: in the future, `#![feature(uniform_paths)]` may become the default + | |_________^ +... +LL | m!(); + | ----- in this macro invocation + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.rs b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.rs index a69eb101917..2791d4580da 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.rs +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.rs @@ -14,7 +14,7 @@ mod foo { pub use std::io; - //~^ ERROR `std` import is ambiguous + //~^ ERROR `std` is ambiguous mod std { pub struct io; diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.stderr b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.stderr index 7538d3d2d91..7bcfc563d39 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.stderr +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity-nested.stderr @@ -1,16 +1,20 @@ -error: `std` import is ambiguous +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity-nested.rs:16:13 | -LL | pub use std::io; - | ^^^ can refer to external crate `::std` -... +LL | pub use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-nested.rs:19:5 + | LL | / mod std { LL | | pub struct io; LL | | } - | |_____- may refer to `self::std` in the future - | - = help: write `::std` or `self::std` explicitly instead - = note: in the future, `#![feature(uniform_paths)]` may become the default + | |_____^ + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.rs b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.rs index 500e9f6c63f..2bfbb6b2871 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.rs +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.rs @@ -11,7 +11,7 @@ // edition:2018 use std::io; -//~^ ERROR `std` import is ambiguous +//~^ ERROR `std` is ambiguous mod std { pub struct io; diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.stderr b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.stderr index 7b64b8f0246..beeb74654e5 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.stderr +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/ambiguity.stderr @@ -1,16 +1,20 @@ -error: `std` import is ambiguous +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity.rs:13:5 | -LL | use std::io; - | ^^^ can refer to external crate `::std` -... +LL | use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity.rs:16:1 + | LL | / mod std { LL | | pub struct io; LL | | } - | |_- may refer to `self::std` in the future - | - = help: write `::std` or `self::std` explicitly instead - = note: in the future, `#![feature(uniform_paths)]` may become the default + | |_^ + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.rs b/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.rs index ca488fec516..2853b4b3a5b 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.rs +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.rs @@ -16,6 +16,6 @@ fn main() { fn std() {} enum std {} use std as foo; - //~^ ERROR `std` import is ambiguous - //~| ERROR `std` import is ambiguous + //~^ ERROR `std` is ambiguous + //~| ERROR `std` is ambiguous } diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.stderr b/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.stderr index 27e0e883691..5d539e2d59f 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.stderr +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/block-scoped-shadow.stderr @@ -1,31 +1,39 @@ -error: `std` import is ambiguous +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/block-scoped-shadow.rs:18:9 | -LL | struct std; - | ----------- may refer to `self::std` in the future -... -LL | enum std {} - | ----------- shadowed by block-scoped `std` LL | use std as foo; - | ^^^ can refer to external crate `::std` + | ^^^ ambiguous name | - = help: write `::std` or `self::std` explicitly instead - = note: in the future, `#![feature(uniform_paths)]` may become the default +note: `std` could refer to the enum defined here + --> $DIR/block-scoped-shadow.rs:17:5 + | +LL | enum std {} + | ^^^^^^^^^^^ +note: `std` could also refer to the struct defined here + --> $DIR/block-scoped-shadow.rs:13:1 + | +LL | struct std; + | ^^^^^^^^^^^ + = help: use `self::std` to refer to this struct unambiguously -error: `std` import is ambiguous +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/block-scoped-shadow.rs:18:9 | -LL | struct std; - | ----------- may refer to `self::std` in the future -... -LL | fn std() {} - | ----------- shadowed by block-scoped `std` -LL | enum std {} LL | use std as foo; - | ^^^ + | ^^^ ambiguous name + | +note: `std` could refer to the function defined here + --> $DIR/block-scoped-shadow.rs:16:5 | - = help: write `self::std` explicitly instead - = note: in the future, `#![feature(uniform_paths)]` may become the default +LL | fn std() {} + | ^^^^^^^^^^^ +note: `std` could also refer to the unit struct defined here + --> $DIR/block-scoped-shadow.rs:13:1 + | +LL | struct std; + | ^^^^^^^^^^^ + = help: use `self::std` to refer to this unit struct unambiguously error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths-forward-compat/issue-54253.rs b/src/test/ui/rust-2018/uniform-paths-forward-compat/issue-54253.rs index 1f19a05d7a7..ef2a1e3c70c 100644 --- a/src/test/ui/rust-2018/uniform-paths-forward-compat/issue-54253.rs +++ b/src/test/ui/rust-2018/uniform-paths-forward-compat/issue-54253.rs @@ -10,7 +10,7 @@ // edition:2018 -// Dummy import to introduce `uniform_paths` canaries. +// Dummy import that previously introduced uniform path canaries. use std; // fn version() -> &'static str {""} diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.rs b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.rs index e0992c90666..4819711115c 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.rs +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.rs @@ -10,13 +10,11 @@ // edition:2018 -#![feature(uniform_paths)] - // This test is similar to `ambiguity-macros.rs`, but nested in a module. mod foo { pub use std::io; - //~^ ERROR `std` import is ambiguous + //~^ ERROR `std` is ambiguous macro_rules! m { () => { diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr index 154ee412e72..204e0a7e141 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr @@ -1,16 +1,23 @@ -error: `std` import is ambiguous - --> $DIR/ambiguity-macros-nested.rs:18:13 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) + --> $DIR/ambiguity-macros-nested.rs:16:13 + | +LL | pub use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-macros-nested.rs:21:13 | -LL | pub use std::io; - | ^^^ can refer to external crate `::std` -... LL | / mod std { LL | | pub struct io; LL | | } - | |_____________- can refer to `self::std` - | - = help: write `::std` or `self::std` explicitly instead - = note: relative `use` paths enabled by `#![feature(uniform_paths)]` + | |_____________^ +... +LL | m!(); + | ----- in this macro invocation + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.rs b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.rs index 9439d92aa71..148320de556 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.rs +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.rs @@ -10,12 +10,10 @@ // edition:2018 -#![feature(uniform_paths)] - // This test is similar to `ambiguity.rs`, but with macros defining local items. use std::io; -//~^ ERROR `std` import is ambiguous +//~^ ERROR `std` is ambiguous macro_rules! m { () => { diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr index 3c0d5601f9c..ac8d3b9d0cb 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr @@ -1,16 +1,23 @@ -error: `std` import is ambiguous - --> $DIR/ambiguity-macros.rs:17:5 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) + --> $DIR/ambiguity-macros.rs:15:5 + | +LL | use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-macros.rs:20:9 | -LL | use std::io; - | ^^^ can refer to external crate `::std` -... LL | / mod std { LL | | pub struct io; LL | | } - | |_________- can refer to `self::std` - | - = help: write `::std` or `self::std` explicitly instead - = note: relative `use` paths enabled by `#![feature(uniform_paths)]` + | |_________^ +... +LL | m!(); + | ----- in this macro invocation + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.rs b/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.rs index 1756acc6057..2791d4580da 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.rs +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.rs @@ -10,13 +10,11 @@ // edition:2018 -#![feature(uniform_paths)] - // This test is similar to `ambiguity.rs`, but nested in a module. mod foo { pub use std::io; - //~^ ERROR `std` import is ambiguous + //~^ ERROR `std` is ambiguous mod std { pub struct io; diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.stderr index a607eeb0b43..7bcfc563d39 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.stderr +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.stderr @@ -1,16 +1,20 @@ -error: `std` import is ambiguous - --> $DIR/ambiguity-nested.rs:18:13 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) + --> $DIR/ambiguity-nested.rs:16:13 + | +LL | pub use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-nested.rs:19:5 | -LL | pub use std::io; - | ^^^ can refer to external crate `::std` -... LL | / mod std { LL | | pub struct io; LL | | } - | |_____- can refer to `self::std` - | - = help: write `::std` or `self::std` explicitly instead - = note: relative `use` paths enabled by `#![feature(uniform_paths)]` + | |_____^ + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity.rs b/src/test/ui/rust-2018/uniform-paths/ambiguity.rs index 9ae3d79c22c..2bfbb6b2871 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity.rs +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity.rs @@ -10,10 +10,8 @@ // edition:2018 -#![feature(uniform_paths)] - use std::io; -//~^ ERROR `std` import is ambiguous +//~^ ERROR `std` is ambiguous mod std { pub struct io; diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity.stderr index c65db3072f4..beeb74654e5 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity.stderr +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity.stderr @@ -1,16 +1,20 @@ -error: `std` import is ambiguous - --> $DIR/ambiguity.rs:15:5 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) + --> $DIR/ambiguity.rs:13:5 + | +LL | use std::io; + | ^^^ ambiguous name + | + = note: `std` could refer to a built-in extern crate + = help: use `::std` to refer to this extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity.rs:16:1 | -LL | use std::io; - | ^^^ can refer to external crate `::std` -... LL | / mod std { LL | | pub struct io; LL | | } - | |_- can refer to `self::std` - | - = help: write `::std` or `self::std` explicitly instead - = note: relative `use` paths enabled by `#![feature(uniform_paths)]` + | |_^ + = help: use `self::std` to refer to this module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs new file mode 100644 index 00000000000..19be7dc9640 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.rs @@ -0,0 +1,22 @@ +// edition:2018 + +#![feature(uniform_paths)] + +mod my { + pub mod sub { + pub fn bar() {} + } +} + +mod sub { + pub fn bar() {} +} + +fn foo() { + use my::sub; + { + use sub::bar; //~ ERROR `sub` is ambiguous + } +} + +fn main() {} diff --git a/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr new file mode 100644 index 00000000000..aa46947f93f --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr @@ -0,0 +1,23 @@ +error[E0659]: `sub` is ambiguous (name vs any other name during import resolution) + --> $DIR/block-scoped-shadow-nested.rs:18:13 + | +LL | use sub::bar; //~ ERROR `sub` is ambiguous + | ^^^ ambiguous name + | +note: `sub` could refer to the module imported here + --> $DIR/block-scoped-shadow-nested.rs:16:9 + | +LL | use my::sub; + | ^^^^^^^ +note: `sub` could also refer to the module defined here + --> $DIR/block-scoped-shadow-nested.rs:11:1 + | +LL | / mod sub { +LL | | pub fn bar() {} +LL | | } + | |_^ + = help: use `self::sub` to refer to this module unambiguously + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.rs b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.rs index ee141d444b2..ec0479ce8f1 100644 --- a/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.rs +++ b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.rs @@ -10,22 +10,20 @@ // edition:2018 -#![feature(uniform_paths)] - -enum Foo { A, B } +enum Foo {} struct std; fn main() { - enum Foo {} + enum Foo { A, B } use Foo::*; - //~^ ERROR `Foo` import is ambiguous + //~^ ERROR `Foo` is ambiguous let _ = (A, B); fn std() {} enum std {} use std as foo; - //~^ ERROR `std` import is ambiguous - //~| ERROR `std` import is ambiguous + //~^ ERROR `std` is ambiguous + //~| ERROR `std` is ambiguous } diff --git a/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr index 86d95f2ac45..010b9efad39 100644 --- a/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr +++ b/src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr @@ -1,45 +1,57 @@ -error: `Foo` import is ambiguous - --> $DIR/block-scoped-shadow.rs:21:9 - | -LL | enum Foo { A, B } - | ----------------- can refer to `self::Foo` -... -LL | enum Foo {} - | ----------- shadowed by block-scoped `Foo` +error[E0659]: `Foo` is ambiguous (name vs any other name during import resolution) + --> $DIR/block-scoped-shadow.rs:19:9 + | LL | use Foo::*; - | ^^^ + | ^^^ ambiguous name + | +note: `Foo` could refer to the enum defined here + --> $DIR/block-scoped-shadow.rs:18:5 | - = help: write `self::Foo` explicitly instead - = note: relative `use` paths enabled by `#![feature(uniform_paths)]` +LL | enum Foo { A, B } + | ^^^^^^^^^^^^^^^^^ +note: `Foo` could also refer to the enum defined here + --> $DIR/block-scoped-shadow.rs:13:1 + | +LL | enum Foo {} + | ^^^^^^^^^^^ + = help: use `self::Foo` to refer to this enum unambiguously -error: `std` import is ambiguous - --> $DIR/block-scoped-shadow.rs:28:9 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) + --> $DIR/block-scoped-shadow.rs:26:9 | -LL | struct std; - | ----------- can refer to `self::std` -... -LL | enum std {} - | ----------- shadowed by block-scoped `std` LL | use std as foo; - | ^^^ can refer to external crate `::std` + | ^^^ ambiguous name | - = help: write `::std` or `self::std` explicitly instead - = note: relative `use` paths enabled by `#![feature(uniform_paths)]` - -error: `std` import is ambiguous - --> $DIR/block-scoped-shadow.rs:28:9 +note: `std` could refer to the enum defined here + --> $DIR/block-scoped-shadow.rs:25:5 | -LL | struct std; - | ----------- can refer to `self::std` -... -LL | fn std() {} - | ----------- shadowed by block-scoped `std` LL | enum std {} + | ^^^^^^^^^^^ +note: `std` could also refer to the struct defined here + --> $DIR/block-scoped-shadow.rs:15:1 + | +LL | struct std; + | ^^^^^^^^^^^ + = help: use `self::std` to refer to this struct unambiguously + +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) + --> $DIR/block-scoped-shadow.rs:26:9 + | LL | use std as foo; - | ^^^ + | ^^^ ambiguous name | - = help: write `self::std` explicitly instead - = note: relative `use` paths enabled by `#![feature(uniform_paths)]` +note: `std` could refer to the function defined here + --> $DIR/block-scoped-shadow.rs:24:5 + | +LL | fn std() {} + | ^^^^^^^^^^^ +note: `std` could also refer to the unit struct defined here + --> $DIR/block-scoped-shadow.rs:15:1 + | +LL | struct std; + | ^^^^^^^^^^^ + = help: use `self::std` to refer to this unit struct unambiguously error: aborting due to 3 previous errors +For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/rust-2018/uniform-paths/deadlock.rs b/src/test/ui/rust-2018/uniform-paths/deadlock.rs new file mode 100644 index 00000000000..3228d799083 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/deadlock.rs @@ -0,0 +1,7 @@ +// edition:2018 +// compile-flags:--extern foo --extern bar + +use foo::bar; //~ ERROR unresolved import +use bar::foo; + +fn main() {} diff --git a/src/test/ui/rust-2018/uniform-paths/deadlock.stderr b/src/test/ui/rust-2018/uniform-paths/deadlock.stderr new file mode 100644 index 00000000000..8bbc8f33039 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/deadlock.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import + --> $DIR/deadlock.rs:4:5 + | +LL | use foo::bar; //~ ERROR unresolved import + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/rust-2018/uniform-paths/fn-local-enum.rs b/src/test/ui/rust-2018/uniform-paths/fn-local-enum.rs new file mode 100644 index 00000000000..a7bc625bbf0 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/fn-local-enum.rs @@ -0,0 +1,15 @@ +// compile-pass +// edition:2018 + +#![feature(uniform_paths)] + +fn main() { + enum E { A, B, C } + + use E::*; + match A { + A => {} + B => {} + C => {} + } +} diff --git a/src/test/ui/rust-2018/uniform-paths/from-decl-macro.rs b/src/test/ui/rust-2018/uniform-paths/from-decl-macro.rs new file mode 100644 index 00000000000..5c3c753f9a7 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/from-decl-macro.rs @@ -0,0 +1,12 @@ +// compile-pass +// edition:2018 + +#![feature(decl_macro)] + +macro check() { + ::std::vec::Vec::<u8>::new() +} + +fn main() { + check!(); +} diff --git a/src/test/ui/rust-2018/uniform-paths/issue-54253.rs b/src/test/ui/rust-2018/uniform-paths/issue-54253.rs index 7ca5c9e9eae..ef2a1e3c70c 100644 --- a/src/test/ui/rust-2018/uniform-paths/issue-54253.rs +++ b/src/test/ui/rust-2018/uniform-paths/issue-54253.rs @@ -10,9 +10,7 @@ // edition:2018 -#![feature(uniform_paths)] - -// Dummy import to introduce `uniform_paths` canaries. +// Dummy import that previously introduced uniform path canaries. use std; // fn version() -> &'static str {""} diff --git a/src/test/ui/rust-2018/uniform-paths/issue-54253.stderr b/src/test/ui/rust-2018/uniform-paths/issue-54253.stderr index 0016e21ef4d..6dcc451c60a 100644 --- a/src/test/ui/rust-2018/uniform-paths/issue-54253.stderr +++ b/src/test/ui/rust-2018/uniform-paths/issue-54253.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `crate::version` - --> $DIR/issue-54253.rs:22:9 + --> $DIR/issue-54253.rs:20:9 | LL | use crate::version; //~ ERROR unresolved import `crate::version` | ^^^^^^^^^^^^^^ no `version` in the root diff --git a/src/test/ui/rust-2018/uniform-paths/issue-54390.rs b/src/test/ui/rust-2018/uniform-paths/issue-54390.rs new file mode 100644 index 00000000000..536cc25e35a --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/issue-54390.rs @@ -0,0 +1,11 @@ +// edition:2018 + +#![deny(unused)] + +use std::fmt; + +// No "unresolved import" + "unused import" combination here. +use fmt::Write; //~ ERROR imports can only refer to extern crate names + //~| ERROR unused import: `fmt::Write` + +fn main() {} diff --git a/src/test/ui/rust-2018/uniform-paths/issue-54390.stderr b/src/test/ui/rust-2018/uniform-paths/issue-54390.stderr new file mode 100644 index 00000000000..8f86698c9c1 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/issue-54390.stderr @@ -0,0 +1,32 @@ +error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130) + --> $DIR/issue-54390.rs:8:5 + | +LL | use std::fmt; + | -------- not an extern crate passed with `--extern` +... +LL | use fmt::Write; //~ ERROR imports can only refer to extern crate names + | ^^^ + | + = help: add #![feature(uniform_paths)] to the crate attributes to enable +note: this import refers to the module imported here + --> $DIR/issue-54390.rs:5:5 + | +LL | use std::fmt; + | ^^^^^^^^ + +error: unused import: `fmt::Write` + --> $DIR/issue-54390.rs:8:5 + | +LL | use fmt::Write; //~ ERROR imports can only refer to extern crate names + | ^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/issue-54390.rs:3:9 + | +LL | #![deny(unused)] + | ^^^^^^ + = note: #[deny(unused_imports)] implied by #[deny(unused)] + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/rust-2018/uniform-paths/macro-rules.rs b/src/test/ui/rust-2018/uniform-paths/macro-rules.rs new file mode 100644 index 00000000000..e8098a46790 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/macro-rules.rs @@ -0,0 +1,44 @@ +// edition:2018 + +// For the time being `macro_rules` items are treated as *very* private... + +#![feature(underscore_imports, decl_macro, uniform_paths)] + +mod m1 { + macro_rules! legacy_macro { () => () } + + // ... so they can't be imported by themselves, ... + use legacy_macro as _; //~ ERROR `legacy_macro` is private, and cannot be re-exported +} + +mod m2 { + macro_rules! legacy_macro { () => () } + + type legacy_macro = u8; + + // ... but don't prevent names from other namespaces from being imported, ... + use legacy_macro as _; // OK +} + +mod m3 { + macro legacy_macro() {} + + fn f() { + macro_rules! legacy_macro { () => () } + + // ... but still create ambiguities with other names in the same namespace. + use legacy_macro as _; //~ ERROR `legacy_macro` is ambiguous + //~| ERROR `legacy_macro` is private, and cannot be re-exported + } +} + +mod exported { + // Exported macros are treated as private as well, + // some better rules need to be figured out later. + #[macro_export] + macro_rules! legacy_macro { () => () } + + use legacy_macro as _; //~ ERROR `legacy_macro` is private, and cannot be re-exported +} + +fn main() {} diff --git a/src/test/ui/rust-2018/uniform-paths/macro-rules.stderr b/src/test/ui/rust-2018/uniform-paths/macro-rules.stderr new file mode 100644 index 00000000000..d7bb233dfe9 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/macro-rules.stderr @@ -0,0 +1,58 @@ +error[E0364]: `legacy_macro` is private, and cannot be re-exported + --> $DIR/macro-rules.rs:11:9 + | +LL | use legacy_macro as _; //~ ERROR `legacy_macro` is private, and cannot be re-exported + | ^^^^^^^^^^^^^^^^^ + | +note: consider marking `legacy_macro` as `pub` in the imported module + --> $DIR/macro-rules.rs:11:9 + | +LL | use legacy_macro as _; //~ ERROR `legacy_macro` is private, and cannot be re-exported + | ^^^^^^^^^^^^^^^^^ + +error[E0364]: `legacy_macro` is private, and cannot be re-exported + --> $DIR/macro-rules.rs:30:13 + | +LL | use legacy_macro as _; //~ ERROR `legacy_macro` is ambiguous + | ^^^^^^^^^^^^^^^^^ + | +note: consider marking `legacy_macro` as `pub` in the imported module + --> $DIR/macro-rules.rs:30:13 + | +LL | use legacy_macro as _; //~ ERROR `legacy_macro` is ambiguous + | ^^^^^^^^^^^^^^^^^ + +error[E0364]: `legacy_macro` is private, and cannot be re-exported + --> $DIR/macro-rules.rs:41:9 + | +LL | use legacy_macro as _; //~ ERROR `legacy_macro` is private, and cannot be re-exported + | ^^^^^^^^^^^^^^^^^ + | +note: consider marking `legacy_macro` as `pub` in the imported module + --> $DIR/macro-rules.rs:41:9 + | +LL | use legacy_macro as _; //~ ERROR `legacy_macro` is private, and cannot be re-exported + | ^^^^^^^^^^^^^^^^^ + +error[E0659]: `legacy_macro` is ambiguous (name vs any other name during import resolution) + --> $DIR/macro-rules.rs:30:13 + | +LL | use legacy_macro as _; //~ ERROR `legacy_macro` is ambiguous + | ^^^^^^^^^^^^ ambiguous name + | +note: `legacy_macro` could refer to the macro defined here + --> $DIR/macro-rules.rs:27:9 + | +LL | macro_rules! legacy_macro { () => () } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: `legacy_macro` could also refer to the macro defined here + --> $DIR/macro-rules.rs:24:5 + | +LL | macro legacy_macro() {} + | ^^^^^^^^^^^^^^^^^^^^^^^ + = help: use `self::legacy_macro` to refer to this macro unambiguously + +error: aborting due to 4 previous errors + +Some errors occurred: E0364, E0659. +For more information about an error, try `rustc --explain E0364`. diff --git a/src/test/ui/rust-2018/uniform-paths/prelude-fail.rs b/src/test/ui/rust-2018/uniform-paths/prelude-fail.rs new file mode 100644 index 00000000000..c5bd50f2f56 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/prelude-fail.rs @@ -0,0 +1,13 @@ +// edition:2018 + +#![feature(uniform_paths)] + +// Built-in macro +use env as env_imported; //~ ERROR cannot import a built-in macro + +// Tool attribute +use rustfmt::skip as imported_rustfmt_skip; //~ ERROR unresolved import `rustfmt` + +fn main() { + env_imported!("PATH"); +} diff --git a/src/test/ui/rust-2018/uniform-paths/prelude-fail.stderr b/src/test/ui/rust-2018/uniform-paths/prelude-fail.stderr new file mode 100644 index 00000000000..794d986b82e --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/prelude-fail.stderr @@ -0,0 +1,15 @@ +error: cannot import a built-in macro + --> $DIR/prelude-fail.rs:6:5 + | +LL | use env as env_imported; //~ ERROR cannot import a built-in macro + | ^^^^^^^^^^^^^^^^^^^ + +error[E0432]: unresolved import `rustfmt` + --> $DIR/prelude-fail.rs:9:5 + | +LL | use rustfmt::skip as imported_rustfmt_skip; //~ ERROR unresolved import `rustfmt` + | ^^^^^^^ not a module `rustfmt` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/rust-2018/uniform-paths/prelude.rs b/src/test/ui/rust-2018/uniform-paths/prelude.rs new file mode 100644 index 00000000000..5aab5fc3a40 --- /dev/null +++ b/src/test/ui/rust-2018/uniform-paths/prelude.rs @@ -0,0 +1,28 @@ +// compile-pass +// edition:2018 + +#![feature(uniform_paths)] + +// Macro imported with `#[macro_use] extern crate` +use vec as imported_vec; + +// Built-in attribute +use inline as imported_inline; + +// Tool module +use rustfmt as imported_rustfmt; + +// Standard library prelude +use Vec as ImportedVec; + +// Built-in type +use u8 as imported_u8; + +type A = imported_u8; + +#[imported_inline] +#[imported_rustfmt::skip] +fn main() { + imported_vec![0]; + ImportedVec::<u8>::new(); +} diff --git a/src/test/ui/rust-2018/uniform-paths/redundant.rs b/src/test/ui/rust-2018/uniform-paths/redundant.rs index 745ac18e059..05048cfd451 100644 --- a/src/test/ui/rust-2018/uniform-paths/redundant.rs +++ b/src/test/ui/rust-2018/uniform-paths/redundant.rs @@ -11,8 +11,6 @@ // run-pass // edition:2018 -#![feature(uniform_paths)] - use std; use std::io; diff --git a/src/test/ui/span/macro-ty-params.stderr b/src/test/ui/span/macro-ty-params.stderr index 3988dec88d5..8a40556a6cd 100644 --- a/src/test/ui/span/macro-ty-params.stderr +++ b/src/test/ui/span/macro-ty-params.stderr @@ -5,6 +5,12 @@ LL | m!(MyTrait<>); //~ ERROR generic arguments in macro path | ^^^^^^^^^ error: generic arguments in macro path + --> $DIR/macro-ty-params.rs:20:15 + | +LL | m!(MyTrait<>); //~ ERROR generic arguments in macro path + | ^^ + +error: generic arguments in macro path --> $DIR/macro-ty-params.rs:18:8 | LL | foo::<T>!(); //~ ERROR generic arguments in macro path @@ -16,11 +22,5 @@ error: generic arguments in macro path LL | foo::<>!(); //~ ERROR generic arguments in macro path | ^^^^ -error: generic arguments in macro path - --> $DIR/macro-ty-params.rs:20:15 - | -LL | m!(MyTrait<>); //~ ERROR generic arguments in macro path - | ^^ - error: aborting due to 4 previous errors diff --git a/src/test/ui/span/non-existing-module-import.stderr b/src/test/ui/span/non-existing-module-import.stderr index 5518b42ac65..1f001530f36 100644 --- a/src/test/ui/span/non-existing-module-import.stderr +++ b/src/test/ui/span/non-existing-module-import.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `std::bar` --> $DIR/non-existing-module-import.rs:11:10 | LL | use std::bar::{foo1, foo2}; //~ ERROR unresolved import - | ^^^ Could not find `bar` in `std` + | ^^^ could not find `bar` in `std` error: aborting due to previous error diff --git a/src/test/ui/static/static-mut-not-pat.stderr b/src/test/ui/static/static-mut-not-pat.stderr index 123cf7b3ac6..96dc06ee524 100644 --- a/src/test/ui/static/static-mut-not-pat.stderr +++ b/src/test/ui/static/static-mut-not-pat.stderr @@ -2,7 +2,7 @@ error[E0530]: match bindings cannot shadow statics --> $DIR/static-mut-not-pat.rs:23:9 | LL | static mut a: isize = 3; - | ------------------------ a static `a` is defined here + | ------------------------ the static `a` is defined here ... LL | a => {} //~ ERROR match bindings cannot shadow statics | ^ cannot be named the same as a static @@ -11,7 +11,7 @@ error[E0530]: match bindings cannot shadow statics --> $DIR/static-mut-not-pat.rs:46:9 | LL | static mut STATIC_MUT_FOO: Foo = Foo { bar: Some(Direction::West), baz: NEW_FALSE }; - | ------------------------------------------------------------------------------------ a static `STATIC_MUT_FOO` is defined here + | ------------------------------------------------------------------------------------ the static `STATIC_MUT_FOO` is defined here ... LL | STATIC_MUT_FOO => (), | ^^^^^^^^^^^^^^ cannot be named the same as a static diff --git a/src/test/ui/super-at-top-level.rs b/src/test/ui/super-at-top-level.rs index c607711c44f..96d099c7655 100644 --- a/src/test/ui/super-at-top-level.rs +++ b/src/test/ui/super-at-top-level.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use super::f; //~ ERROR There are too many initial `super`s +use super::f; //~ ERROR there are too many initial `super`s fn main() { } diff --git a/src/test/ui/super-at-top-level.stderr b/src/test/ui/super-at-top-level.stderr index b4af73055a0..8402daad19e 100644 --- a/src/test/ui/super-at-top-level.stderr +++ b/src/test/ui/super-at-top-level.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. There are too many initial `super`s. +error[E0433]: failed to resolve: there are too many initial `super`s. --> $DIR/super-at-top-level.rs:11:5 | -LL | use super::f; //~ ERROR There are too many initial `super`s - | ^^^^^ There are too many initial `super`s. +LL | use super::f; //~ ERROR there are too many initial `super`s + | ^^^^^ there are too many initial `super`s. error: aborting due to previous error diff --git a/src/test/ui/tool-attributes/tool-attributes-shadowing.rs b/src/test/ui/tool-attributes/tool-attributes-shadowing.rs index b6a24ccf748..11e28857afe 100644 --- a/src/test/ui/tool-attributes/tool-attributes-shadowing.rs +++ b/src/test/ui/tool-attributes/tool-attributes-shadowing.rs @@ -10,5 +10,5 @@ mod rustfmt {} -#[rustfmt::skip] //~ ERROR failed to resolve. Could not find `skip` in `rustfmt` +#[rustfmt::skip] //~ ERROR failed to resolve: could not find `skip` in `rustfmt` fn main() {} diff --git a/src/test/ui/tool-attributes/tool-attributes-shadowing.stderr b/src/test/ui/tool-attributes/tool-attributes-shadowing.stderr index d593350f123..0839e363c36 100644 --- a/src/test/ui/tool-attributes/tool-attributes-shadowing.stderr +++ b/src/test/ui/tool-attributes/tool-attributes-shadowing.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Could not find `skip` in `rustfmt` +error[E0433]: failed to resolve: could not find `skip` in `rustfmt` --> $DIR/tool-attributes-shadowing.rs:13:12 | -LL | #[rustfmt::skip] //~ ERROR failed to resolve. Could not find `skip` in `rustfmt` - | ^^^^ Could not find `skip` in `rustfmt` +LL | #[rustfmt::skip] //~ ERROR failed to resolve: could not find `skip` in `rustfmt` + | ^^^^ could not find `skip` in `rustfmt` error: aborting due to previous error diff --git a/src/test/ui/type/type-path-err-node-types.stderr b/src/test/ui/type/type-path-err-node-types.stderr index c28b30b5456..df7d442239b 100644 --- a/src/test/ui/type/type-path-err-node-types.stderr +++ b/src/test/ui/type/type-path-err-node-types.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `NonExistent` +error[E0433]: failed to resolve: use of undeclared type or module `NonExistent` --> $DIR/type-path-err-node-types.rs:25:5 | LL | NonExistent::Assoc::<u8>; //~ ERROR undeclared type or module `NonExistent` - | ^^^^^^^^^^^ Use of undeclared type or module `NonExistent` + | ^^^^^^^^^^^ use of undeclared type or module `NonExistent` error[E0412]: cannot find type `Nonexistent` in this scope --> $DIR/type-path-err-node-types.rs:17:12 diff --git a/src/test/ui/ufcs/ufcs-partially-resolved.rs b/src/test/ui/ufcs/ufcs-partially-resolved.rs index f7120ddb114..db10197ded1 100644 --- a/src/test/ui/ufcs/ufcs-partially-resolved.rs +++ b/src/test/ui/ufcs/ufcs-partially-resolved.rs @@ -55,9 +55,9 @@ fn main() { <u8 as E::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `E::N` <u8 as A::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `A::N` let _: <u8 as Tr::Y>::NN; //~ ERROR cannot find associated type `NN` in `Tr::Y` - let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y` + let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve: not a module `Y` <u8 as Tr::Y>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::Y` - <u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y` + <u8 as E::Y>::NN; //~ ERROR failed to resolve: not a module `Y` let _: <u8 as Dr>::Z; //~ ERROR expected associated type, found method `Dr::Z` <u8 as Dr>::X; //~ ERROR expected method or associated constant, found associated type `Dr::X` diff --git a/src/test/ui/ufcs/ufcs-partially-resolved.stderr b/src/test/ui/ufcs/ufcs-partially-resolved.stderr index 77d887f1d68..cb571be661d 100644 --- a/src/test/ui/ufcs/ufcs-partially-resolved.stderr +++ b/src/test/ui/ufcs/ufcs-partially-resolved.stderr @@ -1,14 +1,14 @@ -error[E0433]: failed to resolve. Not a module `Y` +error[E0433]: failed to resolve: not a module `Y` --> $DIR/ufcs-partially-resolved.rs:58:22 | -LL | let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y` - | ^ Not a module `Y` +LL | let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve: not a module `Y` + | ^ not a module `Y` -error[E0433]: failed to resolve. Not a module `Y` +error[E0433]: failed to resolve: not a module `Y` --> $DIR/ufcs-partially-resolved.rs:60:15 | -LL | <u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y` - | ^ Not a module `Y` +LL | <u8 as E::Y>::NN; //~ ERROR failed to resolve: not a module `Y` + | ^ not a module `Y` error[E0576]: cannot find associated type `N` in trait `Tr` --> $DIR/ufcs-partially-resolved.rs:29:24 diff --git a/src/test/ui/unknown-tool-name.rs b/src/test/ui/unknown-tool-name.rs index cd2aeb7494a..8d7a6225529 100644 --- a/src/test/ui/unknown-tool-name.rs +++ b/src/test/ui/unknown-tool-name.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[foo::bar] //~ ERROR failed to resolve. Use of undeclared type or module `foo` +#[foo::bar] //~ ERROR failed to resolve: use of undeclared type or module `foo` fn main() {} diff --git a/src/test/ui/unknown-tool-name.stderr b/src/test/ui/unknown-tool-name.stderr index 8381c6de83a..55096614fcd 100644 --- a/src/test/ui/unknown-tool-name.stderr +++ b/src/test/ui/unknown-tool-name.stderr @@ -1,8 +1,8 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `foo` +error[E0433]: failed to resolve: use of undeclared type or module `foo` --> $DIR/unknown-tool-name.rs:11:3 | -LL | #[foo::bar] //~ ERROR failed to resolve. Use of undeclared type or module `foo` - | ^^^ Use of undeclared type or module `foo` +LL | #[foo::bar] //~ ERROR failed to resolve: use of undeclared type or module `foo` + | ^^^ use of undeclared type or module `foo` error: aborting due to previous error diff --git a/src/test/ui/unresolved/unresolved-import.rs b/src/test/ui/unresolved/unresolved-import.rs index efa74946476..4592289beeb 100644 --- a/src/test/ui/unresolved/unresolved-import.rs +++ b/src/test/ui/unresolved/unresolved-import.rs @@ -11,7 +11,7 @@ // ignore-tidy-linelength use foo::bar; //~ ERROR unresolved import `foo` [E0432] - //~^ Maybe a missing `extern crate foo;`? + //~^ maybe a missing `extern crate foo;`? use bar::Baz as x; //~ ERROR unresolved import `bar::Baz` [E0432] //~^ no `Baz` in `bar`. Did you mean to use `Bar`? @@ -42,7 +42,7 @@ mod m { } use MyEnum::*; //~ ERROR unresolved import `MyEnum` [E0432] - //~^ Did you mean `self::MyEnum`? + //~^ did you mean `self::MyEnum`? } mod items { @@ -51,7 +51,7 @@ mod items { } use Enum::*; //~ ERROR unresolved import `Enum` [E0432] - //~^ Did you mean `self::Enum`? + //~^ did you mean `self::Enum`? fn item() {} } diff --git a/src/test/ui/unresolved/unresolved-import.stderr b/src/test/ui/unresolved/unresolved-import.stderr index 9bcebb0011a..7e98a41af10 100644 --- a/src/test/ui/unresolved/unresolved-import.stderr +++ b/src/test/ui/unresolved/unresolved-import.stderr @@ -2,7 +2,7 @@ error[E0432]: unresolved import `foo` --> $DIR/unresolved-import.rs:13:5 | LL | use foo::bar; //~ ERROR unresolved import `foo` [E0432] - | ^^^ Maybe a missing `extern crate foo;`? + | ^^^ maybe a missing `extern crate foo;`? error[E0432]: unresolved import `bar::Baz` --> $DIR/unresolved-import.rs:16:5 @@ -26,13 +26,13 @@ error[E0432]: unresolved import `MyEnum` --> $DIR/unresolved-import.rs:44:9 | LL | use MyEnum::*; //~ ERROR unresolved import `MyEnum` [E0432] - | ^^^^^^ Did you mean `self::MyEnum`? + | ^^^^^^ did you mean `self::MyEnum`? error[E0432]: unresolved import `Enum` --> $DIR/unresolved-import.rs:53:9 | LL | use Enum::*; //~ ERROR unresolved import `Enum` [E0432] - | ^^^^ Did you mean `self::Enum`? + | ^^^^ did you mean `self::Enum`? error: aborting due to 6 previous errors diff --git a/src/test/ui/use/use-from-trait-xc.stderr b/src/test/ui/use/use-from-trait-xc.stderr index f8e5e18097b..6c643dff796 100644 --- a/src/test/ui/use/use-from-trait-xc.stderr +++ b/src/test/ui/use/use-from-trait-xc.stderr @@ -20,19 +20,19 @@ error[E0432]: unresolved import `use_from_trait_xc::Foo` --> $DIR/use-from-trait-xc.rs:24:24 | LL | use use_from_trait_xc::Foo::new; //~ ERROR struct `Foo` is private - | ^^^ Not a module `Foo` + | ^^^ not a module `Foo` error[E0432]: unresolved import `use_from_trait_xc::Foo` --> $DIR/use-from-trait-xc.rs:27:24 | LL | use use_from_trait_xc::Foo::C; //~ ERROR struct `Foo` is private - | ^^^ Not a module `Foo` + | ^^^ not a module `Foo` error[E0432]: unresolved import `use_from_trait_xc::Bar` --> $DIR/use-from-trait-xc.rs:30:24 | LL | use use_from_trait_xc::Bar::new as bnew; - | ^^^ Not a module `Bar` + | ^^^ not a module `Bar` error[E0432]: unresolved import `use_from_trait_xc::Baz::new` --> $DIR/use-from-trait-xc.rs:33:5 diff --git a/src/test/ui/use/use-from-trait.rs b/src/test/ui/use/use-from-trait.rs index 29db949acd0..afa76320582 100644 --- a/src/test/ui/use/use-from-trait.rs +++ b/src/test/ui/use/use-from-trait.rs @@ -18,11 +18,11 @@ use Trait::C; use Foo::new; //~^ ERROR unresolved import `Foo` [E0432] -//~| Not a module `Foo` +//~| not a module `Foo` use Foo::C2; //~^ ERROR unresolved import `Foo` [E0432] -//~| Not a module `Foo` +//~| not a module `Foo` pub trait Trait { fn foo(); diff --git a/src/test/ui/use/use-from-trait.stderr b/src/test/ui/use/use-from-trait.stderr index b43a32988ca..cb0fd94fa6e 100644 --- a/src/test/ui/use/use-from-trait.stderr +++ b/src/test/ui/use/use-from-trait.stderr @@ -20,13 +20,13 @@ error[E0432]: unresolved import `Foo` --> $DIR/use-from-trait.rs:19:5 | LL | use Foo::new; - | ^^^ Not a module `Foo` + | ^^^ not a module `Foo` error[E0432]: unresolved import `Foo` --> $DIR/use-from-trait.rs:23:5 | LL | use Foo::C2; - | ^^^ Not a module `Foo` + | ^^^ not a module `Foo` error: aborting due to 5 previous errors diff --git a/src/test/ui/use/use-mod/use-mod-4.stderr b/src/test/ui/use/use-mod/use-mod-4.stderr index 9a6d608faac..33366b2457b 100644 --- a/src/test/ui/use/use-mod/use-mod-4.stderr +++ b/src/test/ui/use/use-mod/use-mod-4.stderr @@ -14,7 +14,7 @@ error[E0432]: unresolved import `foo` --> $DIR/use-mod-4.rs:11:5 | LL | use foo::self; //~ ERROR unresolved import `foo` - | ^^^ Maybe a missing `extern crate foo;`? + | ^^^ maybe a missing `extern crate foo;`? error: aborting due to 3 previous errors diff --git a/src/test/ui/use/use-self-type.rs b/src/test/ui/use/use-self-type.rs index 6b5286bf0a7..1b49d358261 100644 --- a/src/test/ui/use/use-self-type.rs +++ b/src/test/ui/use/use-self-type.rs @@ -14,7 +14,7 @@ impl S { fn f() {} fn g() { use Self::f; //~ ERROR unresolved import - pub(in Self::f) struct Z; //~ ERROR Use of undeclared type or module `Self` + pub(in Self::f) struct Z; //~ ERROR use of undeclared type or module `Self` } } diff --git a/src/test/ui/use/use-self-type.stderr b/src/test/ui/use/use-self-type.stderr index 5a1e5ea2595..e4cb0f9f3d8 100644 --- a/src/test/ui/use/use-self-type.stderr +++ b/src/test/ui/use/use-self-type.stderr @@ -1,14 +1,14 @@ -error[E0433]: failed to resolve. Use of undeclared type or module `Self` +error[E0433]: failed to resolve: use of undeclared type or module `Self` --> $DIR/use-self-type.rs:17:16 | -LL | pub(in Self::f) struct Z; //~ ERROR Use of undeclared type or module `Self` - | ^^^^ Use of undeclared type or module `Self` +LL | pub(in Self::f) struct Z; //~ ERROR use of undeclared type or module `Self` + | ^^^^ use of undeclared type or module `Self` error[E0432]: unresolved import `Self` --> $DIR/use-self-type.rs:16:13 | LL | use Self::f; //~ ERROR unresolved import - | ^^^^ Use of undeclared type or module `Self` + | ^^^^ use of undeclared type or module `Self` error: aborting due to 2 previous errors diff --git a/src/test/ui/use/use-super-global-path.stderr b/src/test/ui/use/use-super-global-path.stderr index 4730653dbf9..fc4455c7d6e 100644 --- a/src/test/ui/use/use-super-global-path.stderr +++ b/src/test/ui/use/use-super-global-path.stderr @@ -1,10 +1,10 @@ -error[E0433]: failed to resolve. global paths cannot start with `super` +error[E0433]: failed to resolve: global paths cannot start with `super` --> $DIR/use-super-global-path.rs:17:11 | LL | use ::super::{S, Z}; //~ ERROR global paths cannot start with `super` | ^^^^^ global paths cannot start with `super` -error[E0433]: failed to resolve. global paths cannot start with `super` +error[E0433]: failed to resolve: global paths cannot start with `super` --> $DIR/use-super-global-path.rs:20:15 | LL | use ::super::main; //~ ERROR global paths cannot start with `super` |
