diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-11-05 01:11:59 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-11-18 13:51:40 +0300 |
| commit | f0ea1c6f1e2543b905ff486d227e951c8a20756c (patch) | |
| tree | 3e07d994ea1cbbb79a24acb63660a9988fd62c02 /src/test | |
| parent | 9d7d9ada6d108c113ea8728be97dbc19345e9892 (diff) | |
| download | rust-f0ea1c6f1e2543b905ff486d227e951c8a20756c.tar.gz rust-f0ea1c6f1e2543b905ff486d227e951c8a20756c.zip | |
resolve: Improve diagnostics for resolution ambiguities
Diffstat (limited to 'src/test')
35 files changed, 303 insertions, 283 deletions
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..fc55dc1eef6 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 the 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 0720ccb7cf9..00f5cfc2613 100644 --- a/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.stderr +++ b/src/test/ui-fulldeps/proc-macro/ambiguous-builtin-attrs.stderr @@ -4,95 +4,75 @@ error[E0425]: cannot find value `NonExistent` in this scope LL | NonExistent; //~ ERROR cannot find value `NonExistent` in this scope | ^^^^^^^^^^^ not found in this scope -error[E0659]: `repr` is ambiguous +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 the 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 the 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 the 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 the 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 + = help: use `self::feature` to refer to the 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..4950b016d37 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 the attribute macro unambiguously error: aborting due to previous error 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/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-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-shadowing.stderr b/src/test/ui/imports/glob-shadowing.stderr index 33a2963fa29..93d3fa969ef 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 the 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 the 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..9fa438e91cd 100644 --- a/src/test/ui/imports/issue-53269.stderr +++ b/src/test/ui/imports/issue-53269.stderr @@ -4,22 +4,23 @@ error[E0432]: unresolved import `nonexistent_module` LL | use nonexistent_module::mac; //~ ERROR unresolved import `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 the unresolved item unambiguously error: aborting due to 2 previous errors 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..91e569d1764 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 the 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 the 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 the 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..96880492e28 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 the 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..ade49e6be24 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 the 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..4d6c1aa3ea5 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 the 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 the 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 the 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/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-path-prelude-shadowing.stderr b/src/test/ui/macros/macro-path-prelude-shadowing.stderr index 688b9dc2797..3e0ea823642 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 the 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/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/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..b8cbabeea2c 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 the 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 the 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..5c9ab110854 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 the 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 the 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..e98b9ad9a2a 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 the 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 the 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..75387454015 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 the 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 the 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-nested.rs b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.rs index e0992c90666..9f440d71fb0 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 @@ -16,7 +16,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/ambiguity-macros-nested.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr index 154ee412e72..f18de7edcdc 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 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity-macros-nested.rs:18: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 the extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-macros-nested.rs:23:13 + | 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 the 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..f1ed48150c0 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.rs +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.rs @@ -15,7 +15,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/ambiguity-macros.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr index 3c0d5601f9c..16e083b0980 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 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity-macros.rs:17: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 the extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-macros.rs:22:9 + | 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 the 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..0d0d34df1f8 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.rs +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.rs @@ -16,7 +16,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/ambiguity-nested.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-nested.stderr index a607eeb0b43..cb38102c599 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 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity-nested.rs:18: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 the extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity-nested.rs:21:5 + | 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 the 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..259f451e4d2 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity.rs +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity.rs @@ -13,7 +13,7 @@ #![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..ce0c64b226b 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 +error[E0659]: `std` is ambiguous (name vs any other name during import resolution) --> $DIR/ambiguity.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 the extern crate unambiguously +note: `std` could also refer to the module defined here + --> $DIR/ambiguity.rs:18:1 + | 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 the module unambiguously error: aborting due to previous error +For more information about this error, try `rustc --explain E0659`. |
