|
1 | | -warning: Usage of ambiguously imported trait `Trait` |
2 | | - --> $DIR/ambiguous-trait-in-scope.rs:20:9 |
| 1 | +warning: Use of ambiguously glob imported trait `Trait` |
| 2 | + --> $DIR/ambiguous-trait-in-scope.rs:18:9 |
3 | 3 | | |
4 | 4 | LL | use m1::*; |
5 | 5 | | -- `Trait`imported ambiguously here |
6 | 6 | LL | use m2::*; |
7 | 7 | LL | 0u8.method1(); |
8 | 8 | | ^^^^^^^ |
9 | 9 | | |
| 10 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 11 | + = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992> |
10 | 12 | = help: Import `Trait` explicitly |
11 | | - = note: `#[warn(ambiguous_trait_glob_imports)]` on by default |
| 13 | + = note: `#[warn(ambiguous_trait_glob_imports)]` (part of `#[warn(future_incompatible)]`) on by default |
12 | 14 |
|
13 | | -warning: Usage of ambiguously imported trait `Trait` |
14 | | - --> $DIR/ambiguous-trait-in-scope.rs:21:9 |
| 15 | +error[E0599]: no method named `method2` found for type `u8` in the current scope |
| 16 | + --> $DIR/ambiguous-trait-in-scope.rs:20:9 |
15 | 17 | | |
16 | | -LL | use m2::*; |
17 | | - | -- `Trait`imported ambiguously here |
18 | | -LL | 0u8.method1(); |
| 18 | +LL | fn method2(&self) {} |
| 19 | + | ------- the method is available for `u8` here |
| 20 | +... |
19 | 21 | LL | 0u8.method2(); |
20 | 22 | | ^^^^^^^ |
21 | 23 | | |
22 | | - = help: Import `Trait` explicitly |
| 24 | + = 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; |
| 28 | + | |
| 29 | +help: there is a method `method1` with a similar name |
| 30 | + | |
| 31 | +LL - 0u8.method2(); |
| 32 | +LL + 0u8.method1(); |
| 33 | + | |
23 | 34 |
|
24 | | -warning: Usage of ambiguously imported trait `Trait` |
25 | | - --> $DIR/ambiguous-trait-in-scope.rs:28:9 |
| 35 | +error[E0599]: no method named `method1` found for type `u8` in the current scope |
| 36 | + --> $DIR/ambiguous-trait-in-scope.rs:27:9 |
26 | 37 | | |
27 | | -LL | use m1::*; |
28 | | - | -- `Trait`imported ambiguously here |
| 38 | +LL | fn method1(&self) {} |
| 39 | + | ------- the method is available for `u8` here |
| 40 | +... |
29 | 41 | LL | 0u8.method1(); |
30 | 42 | | ^^^^^^^ |
31 | 43 | | |
32 | | - = help: Import `Trait` explicitly |
| 44 | + = 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; |
| 48 | + | |
| 49 | +help: there is a method `method2` with a similar name |
| 50 | + | |
| 51 | +LL - 0u8.method1(); |
| 52 | +LL + 0u8.method2(); |
| 53 | + | |
33 | 54 |
|
34 | | -warning: Usage of ambiguously imported trait `Trait` |
35 | | - --> $DIR/ambiguous-trait-in-scope.rs:29:9 |
| 55 | +warning: Use of ambiguously glob imported trait `Trait` |
| 56 | + --> $DIR/ambiguous-trait-in-scope.rs:28:9 |
36 | 57 | | |
37 | 58 | LL | use m2::*; |
38 | 59 | | -- `Trait`imported ambiguously here |
39 | 60 | ... |
40 | 61 | LL | 0u8.method2(); |
41 | 62 | | ^^^^^^^ |
42 | 63 | | |
| 64 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 65 | + = note: for more information, see issue #147992 <https://github.com/rust-lang/rust/issues/147992> |
43 | 66 | = help: Import `Trait` explicitly |
44 | 67 |
|
45 | | -warning: 4 warnings emitted |
| 68 | +error: aborting due to 2 previous errors; 2 warnings emitted |
46 | 69 |
|
| 70 | +For more information about this error, try `rustc --explain E0599`. |
0 commit comments