Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7de1ff1

Browse files
pierwillcamelidpetrochenkov
committedOct 26, 2021
Edit error messages for rustc_resolve::AmbiguityKind variants
Emit description of the ambiguity as a note. Co-authored-by: Noah Lev <[email protected]> Co-authored-by: Vadim Petrochenkov <[email protected]>
1 parent 84c2a85 commit 7de1ff1

38 files changed

+160
-93
lines changed
 

‎compiler/rustc_resolve/src/diagnostics.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,14 +1165,9 @@ impl<'a> Resolver<'a> {
11651165
(b1, b2, misc1, misc2, false)
11661166
};
11671167

1168-
let mut err = struct_span_err!(
1169-
self.session,
1170-
ident.span,
1171-
E0659,
1172-
"`{ident}` is ambiguous ({why})",
1173-
why = kind.descr()
1174-
);
1168+
let mut err = struct_span_err!(self.session, ident.span, E0659, "`{ident}` is ambiguous");
11751169
err.span_label(ident.span, "ambiguous name");
1170+
err.note(&format!("ambiguous because of {}", kind.descr()));
11761171

11771172
let mut could_refer_to = |b: &NameBinding<'_>, misc: AmbiguityErrorMisc, also: &str| {
11781173
let what = self.binding_description(b, ident, misc == AmbiguityErrorMisc::FromPrelude);

‎compiler/rustc_resolve/src/lib.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -728,23 +728,21 @@ enum AmbiguityKind {
728728
impl AmbiguityKind {
729729
fn descr(self) -> &'static str {
730730
match self {
731-
AmbiguityKind::Import => "name vs any other name during import resolution",
732-
AmbiguityKind::BuiltinAttr => "built-in attribute vs any other name",
733-
AmbiguityKind::DeriveHelper => "derive helper attribute vs any other name",
731+
AmbiguityKind::Import => "multiple potential import sources",
732+
AmbiguityKind::BuiltinAttr => "a name conflict with a builtin attribute",
733+
AmbiguityKind::DeriveHelper => "a name conflict with a derive helper attribute",
734734
AmbiguityKind::MacroRulesVsModularized => {
735-
"`macro_rules` vs non-`macro_rules` from other module"
735+
"a conflict between a `macro_rules` name and a non-`macro_rules` name from another module"
736736
}
737737
AmbiguityKind::GlobVsOuter => {
738-
"glob import vs any other name from outer scope during import/macro resolution"
738+
"a conflict between a name from a glob import and an outer scope during import or macro resolution"
739739
}
740-
AmbiguityKind::GlobVsGlob => "glob import vs glob import in the same module",
740+
AmbiguityKind::GlobVsGlob => "multiple glob imports of a name in the same module",
741741
AmbiguityKind::GlobVsExpanded => {
742-
"glob import vs macro-expanded name in the same \
743-
module during import/macro resolution"
742+
"a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution"
744743
}
745744
AmbiguityKind::MoreExpandedVsOuter => {
746-
"macro-expanded name vs less macro-expanded name \
747-
from outer scope during import/macro resolution"
745+
"a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution"
748746
}
749747
}
750748
}

‎src/test/ui/binding/ambiguity-item.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `f` is ambiguous (glob import vs glob import in the same module)
1+
error[E0659]: `f` is ambiguous
22
--> $DIR/ambiguity-item.rs:14:13
33
|
44
LL | let v = f;
55
| ^ ambiguous name
66
|
7+
= note: ambiguous because of multiple glob imports of a name in the same module
78
note: `f` could refer to the function imported here
89
--> $DIR/ambiguity-item.rs:6:5
910
|
@@ -17,12 +18,13 @@ LL | use n::*; // OK, no conflict with `use m::*;`
1718
| ^^^^
1819
= help: consider adding an explicit import of `f` to disambiguate
1920

20-
error[E0659]: `f` is ambiguous (glob import vs glob import in the same module)
21+
error[E0659]: `f` is ambiguous
2122
--> $DIR/ambiguity-item.rs:16:9
2223
|
2324
LL | f => {}
2425
| ^ ambiguous name
2526
|
27+
= note: ambiguous because of multiple glob imports of a name in the same module
2628
note: `f` could refer to the function imported here
2729
--> $DIR/ambiguity-item.rs:6:5
2830
|

‎src/test/ui/entry-point/imported_main_conflict.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![feature(imported_main)]
2-
//~^ ERROR `main` is ambiguous (glob import vs glob import in the same module)
2+
//~^ ERROR `main` is ambiguous
33
mod m1 { pub(crate) fn main() {} }
44
mod m2 { pub(crate) fn main() {} }
55

‎src/test/ui/entry-point/imported_main_conflict.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
error[E0659]: `main` is ambiguous (glob import vs glob import in the same module)
1+
error[E0659]: `main` is ambiguous
22
|
3+
= note: ambiguous because of multiple glob imports of a name in the same module
34
note: `main` could refer to the function imported here
45
--> $DIR/imported_main_conflict.rs:6:5
56
|

‎src/test/ui/error-codes/E0659.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
1+
error[E0659]: `foo` is ambiguous
22
--> $DIR/E0659.rs:15:15
33
|
44
LL | collider::foo();
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple glob imports of a name in the same module
78
note: `foo` could refer to the function imported here
89
--> $DIR/E0659.rs:10:13
910
|

‎src/test/ui/imports/duplicate.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ LL | use a::foo;
88
|
99
= note: `foo` must be defined only once in the value namespace of this module
1010

11-
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
11+
error[E0659]: `foo` is ambiguous
1212
--> $DIR/duplicate.rs:46:15
1313
|
1414
LL | use self::foo::bar;
1515
| ^^^ ambiguous name
1616
|
17+
= note: ambiguous because of multiple glob imports of a name in the same module
1718
note: `foo` could refer to the module imported here
1819
--> $DIR/duplicate.rs:43:9
1920
|
@@ -27,12 +28,13 @@ LL | use self::m2::*;
2728
| ^^^^^^^^^^^
2829
= help: consider adding an explicit import of `foo` to disambiguate
2930

30-
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
31+
error[E0659]: `foo` is ambiguous
3132
--> $DIR/duplicate.rs:35:8
3233
|
3334
LL | f::foo();
3435
| ^^^ ambiguous name
3536
|
37+
= note: ambiguous because of multiple glob imports of a name in the same module
3638
note: `foo` could refer to the function imported here
3739
--> $DIR/duplicate.rs:24:13
3840
|
@@ -46,12 +48,13 @@ LL | pub use b::*;
4648
| ^^^^
4749
= help: consider adding an explicit import of `foo` to disambiguate
4850

49-
error[E0659]: `foo` is ambiguous (glob import vs glob import in the same module)
51+
error[E0659]: `foo` is ambiguous
5052
--> $DIR/duplicate.rs:49:9
5153
|
5254
LL | foo::bar();
5355
| ^^^ ambiguous name
5456
|
57+
= note: ambiguous because of multiple glob imports of a name in the same module
5558
note: `foo` could refer to the module imported here
5659
--> $DIR/duplicate.rs:43:9
5760
|

‎src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ LL | define_other_core!();
99
|
1010
= note: this error originates in the macro `define_other_core` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

12-
error[E0659]: `Vec` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
12+
error[E0659]: `Vec` is ambiguous
1313
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:13:9
1414
|
1515
LL | Vec::panic!();
1616
| ^^^ ambiguous name
1717
|
18+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
1819
note: `Vec` could refer to the crate imported here
1920
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:5:9
2021
|

‎src/test/ui/imports/glob-shadowing.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `env` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
1+
error[E0659]: `env` is ambiguous
22
--> $DIR/glob-shadowing.rs:11:17
33
|
44
LL | let x = env!("PATH");
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
78
= note: `env` could refer to a macro from prelude
89
note: `env` could also refer to the macro imported here
910
--> $DIR/glob-shadowing.rs:9:9
@@ -13,12 +14,13 @@ LL | use m::*;
1314
= help: consider adding an explicit import of `env` to disambiguate
1415
= help: or use `self::env` to refer to this macro unambiguously
1516

16-
error[E0659]: `env` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
17+
error[E0659]: `env` is ambiguous
1718
--> $DIR/glob-shadowing.rs:19:21
1819
|
1920
LL | let x = env!("PATH");
2021
| ^^^ ambiguous name
2122
|
23+
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
2224
= note: `env` could refer to a macro from prelude
2325
note: `env` could also refer to the macro imported here
2426
--> $DIR/glob-shadowing.rs:17:13
@@ -27,12 +29,13 @@ LL | use m::*;
2729
| ^^^^
2830
= help: consider adding an explicit import of `env` to disambiguate
2931

30-
error[E0659]: `fenv` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
32+
error[E0659]: `fenv` is ambiguous
3133
--> $DIR/glob-shadowing.rs:29:21
3234
|
3335
LL | let x = fenv!();
3436
| ^^^^ ambiguous name
3537
|
38+
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
3639
note: `fenv` could refer to the macro imported here
3740
--> $DIR/glob-shadowing.rs:27:13
3841
|

‎src/test/ui/imports/issue-53269.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ error[E0432]: unresolved import `nonexistent_module`
44
LL | use nonexistent_module::mac;
55
| ^^^^^^^^^^^^^^^^^^ maybe a missing crate `nonexistent_module`?
66

7-
error[E0659]: `mac` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
7+
error[E0659]: `mac` is ambiguous
88
--> $DIR/issue-53269.rs:8:5
99
|
1010
LL | mac!();
1111
| ^^^ ambiguous name
1212
|
13+
= note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module
1314
note: `mac` could refer to the macro defined here
1415
--> $DIR/issue-53269.rs:3:1
1516
|

‎src/test/ui/imports/issue-55884-1.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `S` is ambiguous (glob import vs glob import in the same module)
1+
error[E0659]: `S` is ambiguous
22
--> $DIR/issue-55884-1.rs:19:12
33
|
44
LL | use m::S;
55
| ^ ambiguous name
66
|
7+
= note: ambiguous because of multiple glob imports of a name in the same module
78
note: `S` could refer to the struct imported here
89
--> $DIR/issue-55884-1.rs:14:13
910
|

‎src/test/ui/imports/issue-56125.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ error[E0432]: unresolved import `empty::issue_56125`
44
LL | use empty::issue_56125;
55
| ^^^^^^^^^^^^^^^^^^ no `issue_56125` in `m3::empty`
66

7-
error[E0659]: `issue_56125` is ambiguous (name vs any other name during import resolution)
7+
error[E0659]: `issue_56125` is ambiguous
88
--> $DIR/issue-56125.rs:6:9
99
|
1010
LL | use issue_56125::last_segment::*;
1111
| ^^^^^^^^^^^ ambiguous name
1212
|
13+
= note: ambiguous because of multiple potential import sources
1314
= note: `issue_56125` could refer to a crate passed with `--extern`
1415
= help: use `::issue_56125` to refer to this crate unambiguously
1516
note: `issue_56125` could also refer to the module imported here
@@ -19,12 +20,13 @@ LL | use issue_56125::last_segment::*;
1920
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2021
= help: use `self::issue_56125` to refer to this module unambiguously
2122

22-
error[E0659]: `issue_56125` is ambiguous (name vs any other name during import resolution)
23+
error[E0659]: `issue_56125` is ambiguous
2324
--> $DIR/issue-56125.rs:11:9
2425
|
2526
LL | use issue_56125::non_last_segment::non_last_segment::*;
2627
| ^^^^^^^^^^^ ambiguous name
2728
|
29+
= note: ambiguous because of multiple potential import sources
2830
= note: `issue_56125` could refer to a crate passed with `--extern`
2931
= help: use `::issue_56125` to refer to this crate unambiguously
3032
note: `issue_56125` could also refer to the module imported here
@@ -34,12 +36,13 @@ LL | use issue_56125::non_last_segment::non_last_segment::*;
3436
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3537
= help: use `self::issue_56125` to refer to this module unambiguously
3638

37-
error[E0659]: `issue_56125` is ambiguous (name vs any other name during import resolution)
39+
error[E0659]: `issue_56125` is ambiguous
3840
--> $DIR/issue-56125.rs:18:9
3941
|
4042
LL | use issue_56125::*;
4143
| ^^^^^^^^^^^ ambiguous name
4244
|
45+
= note: ambiguous because of multiple potential import sources
4346
= note: `issue_56125` could refer to a crate passed with `--extern`
4447
= help: use `::issue_56125` to refer to this crate unambiguously
4548
note: `issue_56125` could also refer to the module imported here

‎src/test/ui/imports/issue-57539.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `core` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `core` is ambiguous
22
--> $DIR/issue-57539.rs:4:9
33
|
44
LL | use core;
55
| ^^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
= note: `core` could refer to a built-in crate
89
= help: use `::core` to refer to this crate unambiguously
910
note: `core` could also refer to the module imported here

‎src/test/ui/imports/local-modularized-tricky-fail-1.stderr

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `exported` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
1+
error[E0659]: `exported` is ambiguous
22
--> $DIR/local-modularized-tricky-fail-1.rs:28:1
33
|
44
LL | exported!();
55
| ^^^^^^^^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
78
note: `exported` could refer to the macro defined here
89
--> $DIR/local-modularized-tricky-fail-1.rs:5:5
910
|
@@ -22,12 +23,13 @@ LL | use inner1::*;
2223
= help: consider adding an explicit import of `exported` to disambiguate
2324
= note: this error originates in the macro `define_exported` (in Nightly builds, run with -Z macro-backtrace for more info)
2425

25-
error[E0659]: `exported` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
26+
error[E0659]: `exported` is ambiguous
2627
--> $DIR/local-modularized-tricky-fail-1.rs:28:1
2728
|
2829
LL | exported!();
2930
| ^^^^^^^^ ambiguous name
3031
|
32+
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
3133
note: `exported` could refer to the macro defined here
3234
--> $DIR/local-modularized-tricky-fail-1.rs:5:5
3335
|
@@ -46,12 +48,13 @@ LL | use inner1::*;
4648
= help: consider adding an explicit import of `exported` to disambiguate
4749
= note: this error originates in the macro `define_exported` (in Nightly builds, run with -Z macro-backtrace for more info)
4850

49-
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
51+
error[E0659]: `panic` is ambiguous
5052
--> $DIR/local-modularized-tricky-fail-1.rs:36:5
5153
|
5254
LL | panic!();
5355
| ^^^^^ ambiguous name
5456
|
57+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
5558
= note: `panic` could refer to a macro from prelude
5659
note: `panic` could also refer to the macro defined here
5760
--> $DIR/local-modularized-tricky-fail-1.rs:11:5
@@ -66,12 +69,13 @@ LL | define_panic!();
6669
= help: use `crate::panic` to refer to this macro unambiguously
6770
= note: this error originates in the macro `define_panic` (in Nightly builds, run with -Z macro-backtrace for more info)
6871

69-
error[E0659]: `include` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
72+
error[E0659]: `include` is ambiguous
7073
--> $DIR/local-modularized-tricky-fail-1.rs:47:1
7174
|
7275
LL | include!();
7376
| ^^^^^^^ ambiguous name
7477
|
78+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
7579
= note: `include` could refer to a macro from prelude
7680
note: `include` could also refer to the macro defined here
7781
--> $DIR/local-modularized-tricky-fail-1.rs:17:5

‎src/test/ui/imports/macro-paths.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `bar` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
1+
error[E0659]: `bar` is ambiguous
22
--> $DIR/macro-paths.rs:13:5
33
|
44
LL | bar::m! {
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
78
note: `bar` could refer to the module defined here
89
--> $DIR/macro-paths.rs:14:9
910
|
@@ -16,12 +17,13 @@ LL | use foo::*;
1617
| ^^^^^^
1718
= help: consider adding an explicit import of `bar` to disambiguate
1819

19-
error[E0659]: `baz` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
20+
error[E0659]: `baz` is ambiguous
2021
--> $DIR/macro-paths.rs:23:5
2122
|
2223
LL | baz::m! {
2324
| ^^^ ambiguous name
2425
|
26+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
2527
note: `baz` could refer to the module defined here
2628
--> $DIR/macro-paths.rs:24:9
2729
|

‎src/test/ui/imports/macros.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `m` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
1+
error[E0659]: `m` is ambiguous
22
--> $DIR/macros.rs:16:5
33
|
44
LL | m! {
55
| ^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
78
note: `m` could refer to the macro imported here
89
--> $DIR/macros.rs:18:13
910
|
@@ -16,12 +17,13 @@ LL | use two_macros::*;
1617
| ^^^^^^^^^^^^^
1718
= help: consider adding an explicit import of `m` to disambiguate
1819

19-
error[E0659]: `m` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
20+
error[E0659]: `m` is ambiguous
2021
--> $DIR/macros.rs:16:5
2122
|
2223
LL | m! {
2324
| ^ ambiguous name
2425
|
26+
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
2527
note: `m` could refer to the macro imported here
2628
--> $DIR/macros.rs:18:13
2729
|
@@ -34,12 +36,13 @@ LL | use two_macros::*;
3436
| ^^^^^^^^^^^^^
3537
= help: consider adding an explicit import of `m` to disambiguate
3638

37-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
39+
error[E0659]: `m` is ambiguous
3840
--> $DIR/macros.rs:30:9
3941
|
4042
LL | m! {
4143
| ^ ambiguous name
4244
|
45+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
4346
note: `m` could refer to the macro imported here
4447
--> $DIR/macros.rs:31:17
4548
|

‎src/test/ui/imports/rfc-1560-warning-cycle.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `Foo` is ambiguous (glob import vs glob import in the same module)
1+
error[E0659]: `Foo` is ambiguous
22
--> $DIR/rfc-1560-warning-cycle.rs:9:17
33
|
44
LL | fn f(_: Foo) {}
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple glob imports of a name in the same module
78
note: `Foo` could refer to the struct imported here
89
--> $DIR/rfc-1560-warning-cycle.rs:7:13
910
|

‎src/test/ui/imports/shadow_builtin_macros.stderr

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `panic` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
1+
error[E0659]: `panic` is ambiguous
22
--> $DIR/shadow_builtin_macros.rs:15:14
33
|
44
LL | fn f() { panic!(); }
55
| ^^^^^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
78
= note: `panic` could refer to a macro from prelude
89
note: `panic` could also refer to the macro imported here
910
--> $DIR/shadow_builtin_macros.rs:14:9
@@ -13,12 +14,13 @@ LL | use foo::*;
1314
= help: consider adding an explicit import of `panic` to disambiguate
1415
= help: or use `self::panic` to refer to this macro unambiguously
1516

16-
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
17+
error[E0659]: `panic` is ambiguous
1718
--> $DIR/shadow_builtin_macros.rs:33:5
1819
|
1920
LL | panic!();
2021
| ^^^^^ ambiguous name
2122
|
23+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
2224
= note: `panic` could refer to a macro from prelude
2325
note: `panic` could also refer to the macro defined here
2426
--> $DIR/shadow_builtin_macros.rs:30:9
@@ -30,12 +32,13 @@ LL | m!();
3032
| ---- in this macro invocation
3133
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
3234

33-
error[E0659]: `n` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
35+
error[E0659]: `n` is ambiguous
3436
--> $DIR/shadow_builtin_macros.rs:49:5
3537
|
3638
LL | n!();
3739
| ^ ambiguous name
3840
|
41+
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
3942
note: `n` could refer to the macro imported here
4043
--> $DIR/shadow_builtin_macros.rs:48:9
4144
|
@@ -49,12 +52,13 @@ note: `n` could also refer to the macro imported here
4952
LL | #[macro_use(n)]
5053
| ^
5154

52-
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
55+
error[E0659]: `panic` is ambiguous
5356
--> $DIR/shadow_builtin_macros.rs:20:14
5457
|
5558
LL | fn f() { panic!(); }
5659
| ^^^^^ ambiguous name
5760
|
61+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
5862
= note: `panic` could refer to a macro from prelude
5963
note: `panic` could also refer to the macro imported here
6064
--> $DIR/shadow_builtin_macros.rs:19:26

‎src/test/ui/macros/ambiguity-legacy-vs-modern.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `m` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
1+
error[E0659]: `m` is ambiguous
22
--> $DIR/ambiguity-legacy-vs-modern.rs:31:9
33
|
44
LL | m!()
55
| ^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module
78
note: `m` could refer to the macro defined here
89
--> $DIR/ambiguity-legacy-vs-modern.rs:26:5
910
|
@@ -15,12 +16,13 @@ note: `m` could also refer to the macro defined here
1516
LL | macro m() { 0 }
1617
| ^^^^^^^^^^^^^^^
1718

18-
error[E0659]: `m` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
19+
error[E0659]: `m` is ambiguous
1920
--> $DIR/ambiguity-legacy-vs-modern.rs:43:5
2021
|
2122
LL | m!()
2223
| ^ ambiguous name
2324
|
25+
= note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module
2426
note: `m` could refer to the macro defined here
2527
--> $DIR/ambiguity-legacy-vs-modern.rs:40:9
2628
|

‎src/test/ui/macros/macro-path-prelude-shadowing.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `std` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
1+
error[E0659]: `std` is ambiguous
22
--> $DIR/macro-path-prelude-shadowing.rs:29:9
33
|
44
LL | std::panic!();
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution
78
= note: `std` could refer to a built-in crate
89
note: `std` could also refer to the module imported here
910
--> $DIR/macro-path-prelude-shadowing.rs:27:9

‎src/test/ui/macros/macro-shadowing.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ LL | m1!();
1010
= note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560)
1111
= note: this error originates in the macro `m1` (in Nightly builds, run with -Z macro-backtrace for more info)
1212

13-
error[E0659]: `foo` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
13+
error[E0659]: `foo` is ambiguous
1414
--> $DIR/macro-shadowing.rs:17:1
1515
|
1616
LL | foo!();
1717
| ^^^ ambiguous name
1818
|
19+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
1920
note: `foo` could refer to the macro defined here
2021
--> $DIR/macro-shadowing.rs:10:5
2122
|

‎src/test/ui/macros/out-of-order-shadowing.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `bar` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
1+
error[E0659]: `bar` is ambiguous
22
--> $DIR/out-of-order-shadowing.rs:5:1
33
|
44
LL | bar!();
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
78
note: `bar` could refer to the macro defined here
89
--> $DIR/out-of-order-shadowing.rs:4:1
910
|

‎src/test/ui/macros/restricted-shadowing-legacy.stderr

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
1+
error[E0659]: `m` is ambiguous
22
--> $DIR/restricted-shadowing-legacy.rs:101:13
33
|
44
LL | m!();
@@ -7,6 +7,7 @@ LL | m!();
77
LL | include!();
88
| ---------- in this macro invocation
99
|
10+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
1011
note: `m` could refer to the macro defined here
1112
--> $DIR/restricted-shadowing-legacy.rs:88:9
1213
|
@@ -25,7 +26,7 @@ LL | include!();
2526
| ---------- in this macro invocation
2627
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
2728

28-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
29+
error[E0659]: `m` is ambiguous
2930
--> $DIR/restricted-shadowing-legacy.rs:139:42
3031
|
3132
LL | macro_rules! gen_invoc { () => { m!() } }
@@ -34,6 +35,7 @@ LL | macro_rules! gen_invoc { () => { m!() } }
3435
LL | include!();
3536
| ---------- in this macro invocation
3637
|
38+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
3739
note: `m` could refer to the macro defined here
3840
--> $DIR/restricted-shadowing-legacy.rs:88:9
3941
|
@@ -52,7 +54,7 @@ LL | include!();
5254
| ---------- in this macro invocation
5355
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
5456

55-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
57+
error[E0659]: `m` is ambiguous
5658
--> $DIR/restricted-shadowing-legacy.rs:148:9
5759
|
5860
LL | m!();
@@ -61,6 +63,7 @@ LL | m!();
6163
LL | include!();
6264
| ---------- in this macro invocation
6365
|
66+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
6467
note: `m` could refer to the macro defined here
6568
--> $DIR/restricted-shadowing-legacy.rs:88:9
6669
|
@@ -79,7 +82,7 @@ LL | include!();
7982
| ---------- in this macro invocation
8083
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
8184

82-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
85+
error[E0659]: `m` is ambiguous
8386
--> $DIR/restricted-shadowing-legacy.rs:164:9
8487
|
8588
LL | m!();
@@ -88,6 +91,7 @@ LL | m!();
8891
LL | include!();
8992
| ---------- in this macro invocation
9093
|
94+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
9195
note: `m` could refer to the macro defined here
9296
--> $DIR/restricted-shadowing-legacy.rs:88:9
9397
|
@@ -106,7 +110,7 @@ LL | include!();
106110
| ---------- in this macro invocation
107111
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
108112

109-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
113+
error[E0659]: `m` is ambiguous
110114
--> $DIR/restricted-shadowing-legacy.rs:180:13
111115
|
112116
LL | m!();
@@ -115,6 +119,7 @@ LL | m!();
115119
LL | include!();
116120
| ---------- in this macro invocation
117121
|
122+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
118123
note: `m` could refer to the macro defined here
119124
--> $DIR/restricted-shadowing-legacy.rs:88:9
120125
|
@@ -133,7 +138,7 @@ LL | include!();
133138
| ---------- in this macro invocation
134139
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
135140

136-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
141+
error[E0659]: `m` is ambiguous
137142
--> $DIR/restricted-shadowing-legacy.rs:218:42
138143
|
139144
LL | macro_rules! gen_invoc { () => { m!() } }
@@ -142,6 +147,7 @@ LL | macro_rules! gen_invoc { () => { m!() } }
142147
LL | include!();
143148
| ---------- in this macro invocation
144149
|
150+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
145151
note: `m` could refer to the macro defined here
146152
--> $DIR/restricted-shadowing-legacy.rs:88:9
147153
|
@@ -160,7 +166,7 @@ LL | include!();
160166
| ---------- in this macro invocation
161167
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
162168

163-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
169+
error[E0659]: `m` is ambiguous
164170
--> $DIR/restricted-shadowing-legacy.rs:232:9
165171
|
166172
LL | m!();
@@ -169,6 +175,7 @@ LL | m!();
169175
LL | include!();
170176
| ---------- in this macro invocation
171177
|
178+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
172179
note: `m` could refer to the macro defined here
173180
--> $DIR/restricted-shadowing-legacy.rs:88:9
174181
|
@@ -187,7 +194,7 @@ LL | include!();
187194
| ---------- in this macro invocation
188195
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
189196

190-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
197+
error[E0659]: `m` is ambiguous
191198
--> $DIR/restricted-shadowing-legacy.rs:262:42
192199
|
193200
LL | macro_rules! gen_invoc { () => { m!() } }
@@ -196,6 +203,7 @@ LL | macro_rules! gen_invoc { () => { m!() } }
196203
LL | include!();
197204
| ---------- in this macro invocation
198205
|
206+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
199207
note: `m` could refer to the macro defined here
200208
--> $DIR/restricted-shadowing-legacy.rs:88:9
201209
|

‎src/test/ui/macros/restricted-shadowing-modern.stderr

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
1+
error[E0659]: `m` is ambiguous
22
--> $DIR/restricted-shadowing-modern.rs:104:17
33
|
44
LL | m!();
@@ -7,6 +7,7 @@ LL | m!();
77
LL | include!();
88
| ---------- in this macro invocation
99
|
10+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
1011
note: `m` could refer to the macro defined here
1112
--> $DIR/restricted-shadowing-modern.rs:91:9
1213
|
@@ -25,7 +26,7 @@ LL | include!();
2526
| ---------- in this macro invocation
2627
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
2728

28-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
29+
error[E0659]: `m` is ambiguous
2930
--> $DIR/restricted-shadowing-modern.rs:147:33
3031
|
3132
LL | macro gen_invoc() { m!() }
@@ -34,6 +35,7 @@ LL | macro gen_invoc() { m!() }
3435
LL | include!();
3536
| ---------- in this macro invocation
3637
|
38+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
3739
note: `m` could refer to the macro defined here
3840
--> $DIR/restricted-shadowing-modern.rs:91:9
3941
|
@@ -52,7 +54,7 @@ LL | include!();
5254
| ---------- in this macro invocation
5355
= note: this error originates in the macro `gen_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
5456

55-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
57+
error[E0659]: `m` is ambiguous
5658
--> $DIR/restricted-shadowing-modern.rs:156:13
5759
|
5860
LL | m!();
@@ -61,6 +63,7 @@ LL | m!();
6163
LL | include!();
6264
| ---------- in this macro invocation
6365
|
66+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
6467
note: `m` could refer to the macro defined here
6568
--> $DIR/restricted-shadowing-modern.rs:91:9
6669
|
@@ -79,7 +82,7 @@ LL | include!();
7982
| ---------- in this macro invocation
8083
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
8184

82-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
85+
error[E0659]: `m` is ambiguous
8386
--> $DIR/restricted-shadowing-modern.rs:172:13
8487
|
8588
LL | m!();
@@ -88,6 +91,7 @@ LL | m!();
8891
LL | include!();
8992
| ---------- in this macro invocation
9093
|
94+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
9195
note: `m` could refer to the macro defined here
9296
--> $DIR/restricted-shadowing-modern.rs:91:9
9397
|
@@ -106,7 +110,7 @@ LL | include!();
106110
| ---------- in this macro invocation
107111
= note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
108112

109-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
113+
error[E0659]: `m` is ambiguous
110114
--> $DIR/restricted-shadowing-modern.rs:190:17
111115
|
112116
LL | m!();
@@ -115,6 +119,7 @@ LL | m!();
115119
LL | include!();
116120
| ---------- in this macro invocation
117121
|
122+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
118123
note: `m` could refer to the macro defined here
119124
--> $DIR/restricted-shadowing-modern.rs:91:9
120125
|
@@ -133,7 +138,7 @@ LL | include!();
133138
| ---------- in this macro invocation
134139
= note: this error originates in the macro `gen_gen_inner_invoc` (in Nightly builds, run with -Z macro-backtrace for more info)
135140

136-
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
141+
error[E0659]: `m` is ambiguous
137142
--> $DIR/restricted-shadowing-modern.rs:233:33
138143
|
139144
LL | macro gen_invoc() { m!() }
@@ -142,6 +147,7 @@ LL | macro gen_invoc() { m!() }
142147
LL | include!();
143148
| ---------- in this macro invocation
144149
|
150+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
145151
note: `m` could refer to the macro defined here
146152
--> $DIR/restricted-shadowing-modern.rs:91:9
147153
|

‎src/test/ui/proc-macro/ambiguous-builtin-attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ fn main() {
3535
}
3636

3737
use deny as allow;
38-
#[allow(unused)] //~ ERROR `allow` is ambiguous (built-in attribute vs any other name)
38+
#[allow(unused)] //~ ERROR `allow` is ambiguous
3939
fn builtin_renamed() {}

‎src/test/ui/proc-macro/ambiguous-builtin-attrs.stderr

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ error[E0425]: cannot find value `NonExistent` in this scope
44
LL | NonExistent;
55
| ^^^^^^^^^^^ not found in this scope
66

7-
error[E0659]: `repr` is ambiguous (built-in attribute vs any other name)
7+
error[E0659]: `repr` is ambiguous
88
--> $DIR/ambiguous-builtin-attrs.rs:9:3
99
|
1010
LL | #[repr(C)]
1111
| ^^^^ ambiguous name
1212
|
13+
= note: ambiguous because of a name conflict with a builtin attribute
1314
= note: `repr` could refer to a built-in attribute
1415
note: `repr` could also refer to the attribute macro imported here
1516
--> $DIR/ambiguous-builtin-attrs.rs:6:5
@@ -18,12 +19,13 @@ LL | use builtin_attrs::*;
1819
| ^^^^^^^^^^^^^^^^
1920
= help: use `crate::repr` to refer to this attribute macro unambiguously
2021

21-
error[E0659]: `repr` is ambiguous (built-in attribute vs any other name)
22+
error[E0659]: `repr` is ambiguous
2223
--> $DIR/ambiguous-builtin-attrs.rs:11:19
2324
|
2425
LL | #[cfg_attr(all(), repr(C))]
2526
| ^^^^ ambiguous name
2627
|
28+
= note: ambiguous because of a name conflict with a builtin attribute
2729
= note: `repr` could refer to a built-in attribute
2830
note: `repr` could also refer to the attribute macro imported here
2931
--> $DIR/ambiguous-builtin-attrs.rs:6:5
@@ -32,12 +34,13 @@ LL | use builtin_attrs::*;
3234
| ^^^^^^^^^^^^^^^^
3335
= help: use `crate::repr` to refer to this attribute macro unambiguously
3436

35-
error[E0659]: `repr` is ambiguous (built-in attribute vs any other name)
37+
error[E0659]: `repr` is ambiguous
3638
--> $DIR/ambiguous-builtin-attrs.rs:20:34
3739
|
3840
LL | fn non_macro_expanded_location<#[repr(C)] T>() {
3941
| ^^^^ ambiguous name
4042
|
43+
= note: ambiguous because of a name conflict with a builtin attribute
4144
= note: `repr` could refer to a built-in attribute
4245
note: `repr` could also refer to the attribute macro imported here
4346
--> $DIR/ambiguous-builtin-attrs.rs:6:5
@@ -46,12 +49,13 @@ LL | use builtin_attrs::*;
4649
| ^^^^^^^^^^^^^^^^
4750
= help: use `crate::repr` to refer to this attribute macro unambiguously
4851

49-
error[E0659]: `repr` is ambiguous (built-in attribute vs any other name)
52+
error[E0659]: `repr` is ambiguous
5053
--> $DIR/ambiguous-builtin-attrs.rs:24:11
5154
|
5255
LL | #[repr(C)]
5356
| ^^^^ ambiguous name
5457
|
58+
= note: ambiguous because of a name conflict with a builtin attribute
5559
= note: `repr` could refer to a built-in attribute
5660
note: `repr` could also refer to the attribute macro imported here
5761
--> $DIR/ambiguous-builtin-attrs.rs:6:5
@@ -60,12 +64,13 @@ LL | use builtin_attrs::*;
6064
| ^^^^^^^^^^^^^^^^
6165
= help: use `crate::repr` to refer to this attribute macro unambiguously
6266

63-
error[E0659]: `allow` is ambiguous (built-in attribute vs any other name)
67+
error[E0659]: `allow` is ambiguous
6468
--> $DIR/ambiguous-builtin-attrs.rs:38:3
6569
|
6670
LL | #[allow(unused)]
6771
| ^^^^^ ambiguous name
6872
|
73+
= note: ambiguous because of a name conflict with a builtin attribute
6974
= note: `allow` could refer to a built-in attribute
7075
note: `allow` could also refer to the built-in attribute imported here
7176
--> $DIR/ambiguous-builtin-attrs.rs:37:5
@@ -74,12 +79,13 @@ LL | use deny as allow;
7479
| ^^^^^^^^^^^^^
7580
= help: use `crate::allow` to refer to this built-in attribute unambiguously
7681

77-
error[E0659]: `feature` is ambiguous (built-in attribute vs any other name)
82+
error[E0659]: `feature` is ambiguous
7883
--> $DIR/ambiguous-builtin-attrs.rs:3:4
7984
|
8085
LL | #![feature(decl_macro)]
8186
| ^^^^^^^ ambiguous name
8287
|
88+
= note: ambiguous because of a name conflict with a builtin attribute
8389
= note: `feature` could refer to a built-in attribute
8490
note: `feature` could also refer to the attribute macro imported here
8591
--> $DIR/ambiguous-builtin-attrs.rs:6:5

‎src/test/ui/proc-macro/derive-helper-shadowing.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ LL | gen_helper_use!();
3333
crate::empty_helper
3434
= note: this error originates in the macro `gen_helper_use` (in Nightly builds, run with -Z macro-backtrace for more info)
3535

36-
error[E0659]: `empty_helper` is ambiguous (name vs any other name during import resolution)
36+
error[E0659]: `empty_helper` is ambiguous
3737
--> $DIR/derive-helper-shadowing.rs:26:13
3838
|
3939
LL | use empty_helper;
4040
| ^^^^^^^^^^^^ ambiguous name
4141
|
42+
= note: ambiguous because of multiple potential import sources
4243
note: `empty_helper` could refer to the derive helper attribute defined here
4344
--> $DIR/derive-helper-shadowing.rs:22:10
4445
|
@@ -51,12 +52,13 @@ LL | use test_macros::empty_attr as empty_helper;
5152
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5253
= help: use `crate::empty_helper` to refer to this attribute macro unambiguously
5354

54-
error[E0659]: `empty_helper` is ambiguous (derive helper attribute vs any other name)
55+
error[E0659]: `empty_helper` is ambiguous
5556
--> $DIR/derive-helper-shadowing.rs:19:3
5657
|
5758
LL | #[empty_helper]
5859
| ^^^^^^^^^^^^ ambiguous name
5960
|
61+
= note: ambiguous because of a name conflict with a derive helper attribute
6062
note: `empty_helper` could refer to the derive helper attribute defined here
6163
--> $DIR/derive-helper-shadowing.rs:22:10
6264
|

‎src/test/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `empty_helper` is ambiguous (derive helper attribute vs any other name)
1+
error[E0659]: `empty_helper` is ambiguous
22
--> $DIR/helper-attr-blocked-by-import-ambig.rs:7:3
33
|
44
LL | #[empty_helper]
55
| ^^^^^^^^^^^^ ambiguous name
66
|
7+
= note: ambiguous because of a name conflict with a derive helper attribute
78
note: `empty_helper` could refer to the derive helper attribute defined here
89
--> $DIR/helper-attr-blocked-by-import-ambig.rs:10:10
910
|

‎src/test/ui/proc-macro/issue-41211.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `identity_attr` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
1+
error[E0659]: `identity_attr` is ambiguous
22
--> $DIR/issue-41211.rs:11:4
33
|
44
LL | #![identity_attr]
55
| ^^^^^^^^^^^^^ ambiguous name
66
|
7+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
78
note: `identity_attr` could refer to the attribute macro imported here
89
--> $DIR/issue-41211.rs:14:5
910
|

‎src/test/ui/proc-macro/proc-macro-attributes.stderr

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ error: cannot find attribute `C` in this scope
44
LL | #[C]
55
| ^ help: a derive helper attribute with a similar name exists: `B`
66

7-
error[E0659]: `B` is ambiguous (derive helper attribute vs any other name)
7+
error[E0659]: `B` is ambiguous
88
--> $DIR/proc-macro-attributes.rs:6:3
99
|
1010
LL | #[B]
1111
| ^ ambiguous name
1212
|
13+
= note: ambiguous because of a name conflict with a derive helper attribute
1314
note: `B` could refer to the derive helper attribute defined here
1415
--> $DIR/proc-macro-attributes.rs:19:10
1516
|
@@ -21,12 +22,13 @@ note: `B` could also refer to the derive macro imported here
2122
LL | #[macro_use]
2223
| ^^^^^^^^^^^^
2324

24-
error[E0659]: `B` is ambiguous (derive helper attribute vs any other name)
25+
error[E0659]: `B` is ambiguous
2526
--> $DIR/proc-macro-attributes.rs:10:3
2627
|
2728
LL | #[B(D)]
2829
| ^ ambiguous name
2930
|
31+
= note: ambiguous because of a name conflict with a derive helper attribute
3032
note: `B` could refer to the derive helper attribute defined here
3133
--> $DIR/proc-macro-attributes.rs:19:10
3234
|
@@ -38,12 +40,13 @@ note: `B` could also refer to the derive macro imported here
3840
LL | #[macro_use]
3941
| ^^^^^^^^^^^^
4042

41-
error[E0659]: `B` is ambiguous (derive helper attribute vs any other name)
43+
error[E0659]: `B` is ambiguous
4244
--> $DIR/proc-macro-attributes.rs:13:3
4345
|
4446
LL | #[B(E = "foo")]
4547
| ^ ambiguous name
4648
|
49+
= note: ambiguous because of a name conflict with a derive helper attribute
4750
note: `B` could refer to the derive helper attribute defined here
4851
--> $DIR/proc-macro-attributes.rs:19:10
4952
|
@@ -55,12 +58,13 @@ note: `B` could also refer to the derive macro imported here
5558
LL | #[macro_use]
5659
| ^^^^^^^^^^^^
5760

58-
error[E0659]: `B` is ambiguous (derive helper attribute vs any other name)
61+
error[E0659]: `B` is ambiguous
5962
--> $DIR/proc-macro-attributes.rs:16:3
6063
|
6164
LL | #[B(arbitrary tokens)]
6265
| ^ ambiguous name
6366
|
67+
= note: ambiguous because of a name conflict with a derive helper attribute
6468
note: `B` could refer to the derive helper attribute defined here
6569
--> $DIR/proc-macro-attributes.rs:19:10
6670
|

‎src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `std` is ambiguous
22
--> $DIR/ambiguity-macros-nested.rs:8:13
33
|
44
LL | pub use std::io;
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
= note: `std` could refer to a built-in crate
89
= help: use `::std` to refer to this crate unambiguously
910
note: `std` could also refer to the module defined here

‎src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `std` is ambiguous
22
--> $DIR/ambiguity-macros.rs:7:5
33
|
44
LL | use std::io;
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
= note: `std` could refer to a built-in crate
89
= help: use `::std` to refer to this crate unambiguously
910
note: `std` could also refer to the module defined here

‎src/test/ui/rust-2018/uniform-paths/ambiguity-nested.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `std` is ambiguous
22
--> $DIR/ambiguity-nested.rs:8:13
33
|
44
LL | pub use std::io;
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
= note: `std` could refer to a built-in crate
89
= help: use `::std` to refer to this crate unambiguously
910
note: `std` could also refer to the module defined here

‎src/test/ui/rust-2018/uniform-paths/ambiguity.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `std` is ambiguous
22
--> $DIR/ambiguity.rs:5:5
33
|
44
LL | use std::io;
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
= note: `std` could refer to a built-in crate
89
= help: use `::std` to refer to this crate unambiguously
910
note: `std` could also refer to the module defined here

‎src/test/ui/rust-2018/uniform-paths/block-scoped-shadow-nested.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `sub` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `sub` is ambiguous
22
--> $DIR/block-scoped-shadow-nested.rs:16:13
33
|
44
LL | use sub::bar;
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
note: `sub` could refer to the module imported here
89
--> $DIR/block-scoped-shadow-nested.rs:14:9
910
|

‎src/test/ui/rust-2018/uniform-paths/block-scoped-shadow.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `Foo` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `Foo` is ambiguous
22
--> $DIR/block-scoped-shadow.rs:11:9
33
|
44
LL | use Foo::*;
55
| ^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
note: `Foo` could refer to the enum defined here
89
--> $DIR/block-scoped-shadow.rs:10:5
910
|
@@ -16,12 +17,13 @@ LL | enum Foo {}
1617
| ^^^^^^^^^^^
1718
= help: use `crate::Foo` to refer to this enum unambiguously
1819

19-
error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
20+
error[E0659]: `std` is ambiguous
2021
--> $DIR/block-scoped-shadow.rs:18:9
2122
|
2223
LL | use std as foo;
2324
| ^^^ ambiguous name
2425
|
26+
= note: ambiguous because of multiple potential import sources
2527
note: `std` could refer to the enum defined here
2628
--> $DIR/block-scoped-shadow.rs:17:5
2729
|
@@ -34,12 +36,13 @@ LL | struct std;
3436
| ^^^^^^^^^^^
3537
= help: use `crate::std` to refer to this struct unambiguously
3638

37-
error[E0659]: `std` is ambiguous (name vs any other name during import resolution)
39+
error[E0659]: `std` is ambiguous
3840
--> $DIR/block-scoped-shadow.rs:18:9
3941
|
4042
LL | use std as foo;
4143
| ^^^ ambiguous name
4244
|
45+
= note: ambiguous because of multiple potential import sources
4346
note: `std` could refer to the function defined here
4447
--> $DIR/block-scoped-shadow.rs:16:5
4548
|

‎src/test/ui/rust-2018/uniform-paths/issue-56596.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0659]: `issue_56596` is ambiguous (name vs any other name during import resolution)
1+
error[E0659]: `issue_56596` is ambiguous
22
--> $DIR/issue-56596.rs:12:5
33
|
44
LL | use issue_56596;
55
| ^^^^^^^^^^^ ambiguous name
66
|
7+
= note: ambiguous because of multiple potential import sources
78
= note: `issue_56596` could refer to a crate passed with `--extern`
89
= help: use `::issue_56596` to refer to this crate unambiguously
910
note: `issue_56596` could also refer to the module imported here

‎src/test/ui/rust-2018/uniform-paths/macro-rules.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ note: consider marking `legacy_macro` as `pub` in the imported module
1010
LL | pub use legacy_macro as _;
1111
| ^^^^^^^^^^^^^^^^^
1212

13-
error[E0659]: `legacy_macro` is ambiguous (name vs any other name during import resolution)
13+
error[E0659]: `legacy_macro` is ambiguous
1414
--> $DIR/macro-rules.rs:31:13
1515
|
1616
LL | use legacy_macro as _;
1717
| ^^^^^^^^^^^^ ambiguous name
1818
|
19+
= note: ambiguous because of multiple potential import sources
1920
note: `legacy_macro` could refer to the macro defined here
2021
--> $DIR/macro-rules.rs:28:9
2122
|

0 commit comments

Comments
 (0)
This repository has been archived.