11warning: Use of ambiguously glob imported trait `Trait`
2- --> $DIR/ambiguous-trait-in-scope.rs:18 :9
2+ --> $DIR/ambiguous-trait-in-scope.rs:32 :9
33 |
44LL | use m1::*;
55 | -- `Trait`imported ambiguously here
@@ -10,50 +10,38 @@ LL | 0u8.method1();
1010 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1111 = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992>
1212 = help: Import `Trait` explicitly
13- = note: `#[warn(ambiguous_trait_glob_imports )]` (part of `#[warn(future_incompatible)]`) on by default
13+ = note: `#[warn(ambiguous_glob_imported_trait )]` (part of `#[warn(future_incompatible)]`) on by default
1414
1515error[E0599]: no method named `method2` found for type `u8` in the current scope
16- --> $DIR/ambiguous-trait-in-scope.rs:20 :9
16+ --> $DIR/ambiguous-trait-in-scope.rs:34 :9
1717 |
18- LL | fn method2(&self) {}
19- | ------- the method is available for `u8` here
20- ...
2118LL | 0u8.method2();
22- | ^^^^^^^
19+ | ^^^^^^^ method not found in `u8`
2320 |
2421 = help: items from traits can only be used if the trait is in scope
25- help: trait `Trait` which provides `method2` is implemented but not in scope; perhaps you want to import it
26- |
27- LL + use m2::Trait;
22+ help: the following traits which provide `method2` are implemented but not in scope; perhaps you want to import one of them
2823 |
29- help: there is a method `method1` with a similar name
24+ LL + use ambiguous_trait_reexport::m2::Trait;
3025 |
31- LL - 0u8.method2();
32- LL + 0u8.method1();
26+ LL + use crate::m2::Trait;
3327 |
3428
3529error[E0599]: no method named `method1` found for type `u8` in the current scope
36- --> $DIR/ambiguous-trait-in-scope.rs:27 :9
30+ --> $DIR/ambiguous-trait-in-scope.rs:41 :9
3731 |
38- LL | fn method1(&self) {}
39- | ------- the method is available for `u8` here
40- ...
4132LL | 0u8.method1();
42- | ^^^^^^^
33+ | ^^^^^^^ method not found in `u8`
4334 |
4435 = help: items from traits can only be used if the trait is in scope
45- help: trait `Trait` which provides `method1` is implemented but not in scope; perhaps you want to import it
46- |
47- LL + use m1::Trait;
36+ help: the following traits which provide `method1` are implemented but not in scope; perhaps you want to import one of them
4837 |
49- help: there is a method `method2` with a similar name
38+ LL + use ambiguous_trait_reexport::m1::Trait;
5039 |
51- LL - 0u8.method1();
52- LL + 0u8.method2();
40+ LL + use crate::m1::Trait;
5341 |
5442
5543warning: Use of ambiguously glob imported trait `Trait`
56- --> $DIR/ambiguous-trait-in-scope.rs:28 :9
44+ --> $DIR/ambiguous-trait-in-scope.rs:42 :9
5745 |
5846LL | use m2::*;
5947 | -- `Trait`imported ambiguously here
@@ -65,6 +53,141 @@ LL | 0u8.method2();
6553 = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992>
6654 = help: Import `Trait` explicitly
6755
68- error: aborting due to 2 previous errors; 2 warnings emitted
56+ warning: Use of ambiguously glob imported trait `Trait`
57+ --> $DIR/ambiguous-trait-in-scope.rs:49:9
58+ |
59+ LL | use m1_reexport::*;
60+ | ----------- `Trait`imported ambiguously here
61+ LL | use m2_reexport::*;
62+ LL | 0u8.method1();
63+ | ^^^^^^^
64+ |
65+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
66+ = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992>
67+ = help: Import `Trait` explicitly
68+
69+ error[E0599]: no method named `method2` found for type `u8` in the current scope
70+ --> $DIR/ambiguous-trait-in-scope.rs:51:9
71+ |
72+ LL | 0u8.method2();
73+ | ^^^^^^^ method not found in `u8`
74+ |
75+ = help: items from traits can only be used if the trait is in scope
76+ help: the following traits which provide `method2` are implemented but not in scope; perhaps you want to import one of them
77+ |
78+ LL + use ambiguous_trait_reexport::m2::Trait;
79+ |
80+ LL + use crate::m2::Trait;
81+ |
82+
83+ warning: Use of ambiguously glob imported trait `Trait`
84+ --> $DIR/ambiguous-trait-in-scope.rs:56:9
85+ |
86+ LL | use ambig_reexport::*;
87+ | -------------- `Trait`imported ambiguously here
88+ LL | 0u8.method1();
89+ | ^^^^^^^
90+ |
91+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
92+ = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992>
93+ = help: Import `Trait` explicitly
94+
95+ error[E0599]: no method named `method2` found for type `u8` in the current scope
96+ --> $DIR/ambiguous-trait-in-scope.rs:58:9
97+ |
98+ LL | 0u8.method2();
99+ | ^^^^^^^ method not found in `u8`
100+ |
101+ = help: items from traits can only be used if the trait is in scope
102+ help: the following traits which provide `method2` are implemented but not in scope; perhaps you want to import one of them
103+ |
104+ LL + use ambiguous_trait_reexport::m2::Trait;
105+ |
106+ LL + use crate::m2::Trait;
107+ |
108+
109+ warning: Use of ambiguously glob imported trait `Trait`
110+ --> $DIR/ambiguous-trait-in-scope.rs:64:9
111+ |
112+ LL | use external::m1::*;
113+ | ------------ `Trait`imported ambiguously here
114+ LL | use external::m2::*;
115+ LL | 0u8.method1();
116+ | ^^^^^^^
117+ |
118+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
119+ = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992>
120+ = help: Import `Trait` explicitly
121+
122+ error[E0599]: no method named `method2` found for type `u8` in the current scope
123+ --> $DIR/ambiguous-trait-in-scope.rs:66:9
124+ |
125+ LL | 0u8.method2();
126+ | ^^^^^^^ method not found in `u8`
127+ |
128+ = help: items from traits can only be used if the trait is in scope
129+ help: the following traits which provide `method2` are implemented but not in scope; perhaps you want to import one of them
130+ |
131+ LL + use ambiguous_trait_reexport::m2::Trait;
132+ |
133+ LL + use crate::m2::Trait;
134+ |
135+
136+ warning: Use of ambiguously glob imported trait `Trait`
137+ --> $DIR/ambiguous-trait-in-scope.rs:72:9
138+ |
139+ LL | use external::m1_reexport::*;
140+ | --------------------- `Trait`imported ambiguously here
141+ LL | use external::m2_reexport::*;
142+ LL | 0u8.method1();
143+ | ^^^^^^^
144+ |
145+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
146+ = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992>
147+ = help: Import `Trait` explicitly
148+
149+ error[E0599]: no method named `method2` found for type `u8` in the current scope
150+ --> $DIR/ambiguous-trait-in-scope.rs:74:9
151+ |
152+ LL | 0u8.method2();
153+ | ^^^^^^^ method not found in `u8`
154+ |
155+ = help: items from traits can only be used if the trait is in scope
156+ help: the following traits which provide `method2` are implemented but not in scope; perhaps you want to import one of them
157+ |
158+ LL + use ambiguous_trait_reexport::m2::Trait;
159+ |
160+ LL + use crate::m2::Trait;
161+ |
162+
163+ error[E0599]: no method named `method1` found for type `u8` in the current scope
164+ --> $DIR/ambiguous-trait-in-scope.rs:79:9
165+ |
166+ LL | 0u8.method1();
167+ | ^^^^^^^ method not found in `u8`
168+ |
169+ = help: items from traits can only be used if the trait is in scope
170+ help: the following traits which provide `method1` are implemented but not in scope; perhaps you want to import one of them
171+ |
172+ LL + use ambiguous_trait_reexport::m1::Trait;
173+ |
174+ LL + use crate::m1::Trait;
175+ |
176+
177+ error[E0599]: no method named `method2` found for type `u8` in the current scope
178+ --> $DIR/ambiguous-trait-in-scope.rs:80:9
179+ |
180+ LL | 0u8.method2();
181+ | ^^^^^^^ method not found in `u8`
182+ |
183+ = help: items from traits can only be used if the trait is in scope
184+ help: the following traits which provide `method2` are implemented but not in scope; perhaps you want to import one of them
185+ |
186+ LL + use ambiguous_trait_reexport::m2::Trait;
187+ |
188+ LL + use crate::m2::Trait;
189+ |
190+
191+ error: aborting due to 8 previous errors; 6 warnings emitted
69192
70193For more information about this error, try `rustc --explain E0599`.
0 commit comments