resolve: Improve diagnostics for resolution ambiguities

This commit is contained in:
Vadim Petrochenkov 2018-11-05 01:11:59 +03:00
parent 9d7d9ada6d
commit f0ea1c6f1e
41 changed files with 603 additions and 425 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 }

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -14,7 +14,7 @@
mod foo {
pub use std::io;
//~^ ERROR `std` import is ambiguous
//~^ ERROR `std` is ambiguous
macro_rules! m {
() => {

View file

@ -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`.

View file

@ -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 {
() => {

View file

@ -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`.

View file

@ -14,7 +14,7 @@
mod foo {
pub use std::io;
//~^ ERROR `std` import is ambiguous
//~^ ERROR `std` is ambiguous
mod std {
pub struct io;

View file

@ -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`.

View file

@ -11,7 +11,7 @@
// edition:2018
use std::io;
//~^ ERROR `std` import is ambiguous
//~^ ERROR `std` is ambiguous
mod std {
pub struct io;

View file

@ -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`.

View file

@ -16,7 +16,7 @@
mod foo {
pub use std::io;
//~^ ERROR `std` import is ambiguous
//~^ ERROR `std` is ambiguous
macro_rules! m {
() => {

View file

@ -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`.

View file

@ -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 {
() => {

View file

@ -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`.

View file

@ -16,7 +16,7 @@
mod foo {
pub use std::io;
//~^ ERROR `std` import is ambiguous
//~^ ERROR `std` is ambiguous
mod std {
pub struct io;

View file

@ -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`.

View file

@ -13,7 +13,7 @@
#![feature(uniform_paths)]
use std::io;
//~^ ERROR `std` import is ambiguous
//~^ ERROR `std` is ambiguous
mod std {
pub struct io;

View file

@ -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`.