|
| 1 | +error[E0599]: no method named `method1` found for type `u8` in the current scope |
| 2 | + --> $DIR/ambiguous-trait-in-scope.rs:18:9 |
| 3 | + | |
| 4 | +LL | fn method1(&self) {} |
| 5 | + | ------- the method is available for `u8` here |
| 6 | +... |
| 7 | +LL | 0u8.method1(); |
| 8 | + | ^^^^^^^ |
| 9 | + | |
| 10 | + = help: items from traits can only be used if the trait is in scope |
| 11 | +help: trait `Trait` which provides `method1` is implemented but not in scope; perhaps you want to import it |
| 12 | + | |
| 13 | +LL + use m1::Trait; |
| 14 | + | |
| 15 | +help: there is a method `method2` with a similar name |
| 16 | + | |
| 17 | +LL - 0u8.method1(); |
| 18 | +LL + 0u8.method2(); |
| 19 | + | |
| 20 | + |
| 21 | +error[E0599]: no method named `method2` found for type `u8` in the current scope |
| 22 | + --> $DIR/ambiguous-trait-in-scope.rs:19:9 |
| 23 | + | |
| 24 | +LL | fn method2(&self) {} |
| 25 | + | ------- the method is available for `u8` here |
| 26 | +... |
| 27 | +LL | 0u8.method2(); |
| 28 | + | ^^^^^^^ |
| 29 | + | |
| 30 | + = help: items from traits can only be used if the trait is in scope |
| 31 | +help: trait `Trait` which provides `method2` is implemented but not in scope; perhaps you want to import it |
| 32 | + | |
| 33 | +LL + use m2::Trait; |
| 34 | + | |
| 35 | +help: there is a method `method1` with a similar name |
| 36 | + | |
| 37 | +LL - 0u8.method2(); |
| 38 | +LL + 0u8.method1(); |
| 39 | + | |
| 40 | + |
| 41 | +error[E0599]: no method named `method1` found for type `u8` in the current scope |
| 42 | + --> $DIR/ambiguous-trait-in-scope.rs:26:9 |
| 43 | + | |
| 44 | +LL | fn method1(&self) {} |
| 45 | + | ------- the method is available for `u8` here |
| 46 | +... |
| 47 | +LL | 0u8.method1(); |
| 48 | + | ^^^^^^^ |
| 49 | + | |
| 50 | + = help: items from traits can only be used if the trait is in scope |
| 51 | +help: trait `Trait` which provides `method1` is implemented but not in scope; perhaps you want to import it |
| 52 | + | |
| 53 | +LL + use m1::Trait; |
| 54 | + | |
| 55 | +help: there is a method `method2` with a similar name |
| 56 | + | |
| 57 | +LL - 0u8.method1(); |
| 58 | +LL + 0u8.method2(); |
| 59 | + | |
| 60 | + |
| 61 | +error[E0599]: no method named `method2` found for type `u8` in the current scope |
| 62 | + --> $DIR/ambiguous-trait-in-scope.rs:27:9 |
| 63 | + | |
| 64 | +LL | fn method2(&self) {} |
| 65 | + | ------- the method is available for `u8` here |
| 66 | +... |
| 67 | +LL | 0u8.method2(); |
| 68 | + | ^^^^^^^ |
| 69 | + | |
| 70 | + = help: items from traits can only be used if the trait is in scope |
| 71 | +help: trait `Trait` which provides `method2` is implemented but not in scope; perhaps you want to import it |
| 72 | + | |
| 73 | +LL + use m2::Trait; |
| 74 | + | |
| 75 | +help: there is a method `method1` with a similar name |
| 76 | + | |
| 77 | +LL - 0u8.method2(); |
| 78 | +LL + 0u8.method1(); |
| 79 | + | |
| 80 | + |
| 81 | +error: aborting due to 4 previous errors |
| 82 | + |
| 83 | +For more information about this error, try `rustc --explain E0599`. |
0 commit comments