|
| 1 | +error[E0599]: no method named `foo` found for struct `NonZero` in the current scope |
| 2 | + --> $DIR/non_zero_coerce_fail.rs:15:7 |
| 3 | + | |
| 4 | +LL | x.foo(); |
| 5 | + | ^^^ method not found in `NonZero<u8>` |
| 6 | + | |
| 7 | + = help: items from traits can only be used if the trait is implemented and in scope |
| 8 | +note: `Foo` defines an item `foo`, perhaps you need to implement it |
| 9 | + --> $DIR/non_zero_coerce_fail.rs:3:1 |
| 10 | + | |
| 11 | +LL | trait Foo: Sized { |
| 12 | + | ^^^^^^^^^^^^^^^^ |
| 13 | + |
| 14 | +error[E0599]: no method named `bar` found for struct `NonZero` in the current scope |
| 15 | + --> $DIR/non_zero_coerce_fail.rs:17:7 |
| 16 | + | |
| 17 | +LL | x.bar(); |
| 18 | + | ^^^ method not found in `NonZero<u8>` |
| 19 | + | |
| 20 | + = help: items from traits can only be used if the trait is implemented and in scope |
| 21 | +note: `Foo` defines an item `bar`, perhaps you need to implement it |
| 22 | + --> $DIR/non_zero_coerce_fail.rs:3:1 |
| 23 | + | |
| 24 | +LL | trait Foo: Sized { |
| 25 | + | ^^^^^^^^^^^^^^^^ |
| 26 | + |
| 27 | +error[E0277]: the trait bound `NonZero<u8>: Foo` is not satisfied |
| 28 | + --> $DIR/non_zero_coerce_fail.rs:19:9 |
| 29 | + | |
| 30 | +LL | foo(x); |
| 31 | + | --- ^ the trait `Foo` is not implemented for `NonZero<u8>` |
| 32 | + | | |
| 33 | + | required by a bound introduced by this call |
| 34 | + | |
| 35 | + = help: the following other types implement trait `Foo`: |
| 36 | + u16 |
| 37 | + u8 |
| 38 | +note: required by a bound in `foo` |
| 39 | + --> $DIR/non_zero_coerce_fail.rs:11:16 |
| 40 | + | |
| 41 | +LL | fn foo(_: impl Foo) {} |
| 42 | + | ^^^ required by this bound in `foo` |
| 43 | + |
| 44 | +error[E0599]: no method named `foo` found for struct `NonZero` in the current scope |
| 45 | + --> $DIR/non_zero_coerce_fail.rs:24:7 |
| 46 | + | |
| 47 | +LL | a.foo(); |
| 48 | + | ^^^ method not found in `NonZero<{integer}>` |
| 49 | + | |
| 50 | + = help: items from traits can only be used if the trait is implemented and in scope |
| 51 | +note: `Foo` defines an item `foo`, perhaps you need to implement it |
| 52 | + --> $DIR/non_zero_coerce_fail.rs:3:1 |
| 53 | + | |
| 54 | +LL | trait Foo: Sized { |
| 55 | + | ^^^^^^^^^^^^^^^^ |
| 56 | + |
| 57 | +error[E0599]: no method named `bar` found for struct `NonZero` in the current scope |
| 58 | + --> $DIR/non_zero_coerce_fail.rs:26:7 |
| 59 | + | |
| 60 | +LL | a.bar(); |
| 61 | + | ^^^ method not found in `NonZero<{integer}>` |
| 62 | + | |
| 63 | + = help: items from traits can only be used if the trait is implemented and in scope |
| 64 | +note: `Foo` defines an item `bar`, perhaps you need to implement it |
| 65 | + --> $DIR/non_zero_coerce_fail.rs:3:1 |
| 66 | + | |
| 67 | +LL | trait Foo: Sized { |
| 68 | + | ^^^^^^^^^^^^^^^^ |
| 69 | + |
| 70 | +error[E0277]: the trait bound `NonZero<{integer}>: Foo` is not satisfied |
| 71 | + --> $DIR/non_zero_coerce_fail.rs:28:9 |
| 72 | + | |
| 73 | +LL | foo(a); |
| 74 | + | --- ^ the trait `Foo` is not implemented for `NonZero<{integer}>` |
| 75 | + | | |
| 76 | + | required by a bound introduced by this call |
| 77 | + | |
| 78 | + = help: the following other types implement trait `Foo`: |
| 79 | + u16 |
| 80 | + u8 |
| 81 | +note: required by a bound in `foo` |
| 82 | + --> $DIR/non_zero_coerce_fail.rs:11:16 |
| 83 | + | |
| 84 | +LL | fn foo(_: impl Foo) {} |
| 85 | + | ^^^ required by this bound in `foo` |
| 86 | + |
| 87 | +error: aborting due to 6 previous errors |
| 88 | + |
| 89 | +Some errors have detailed explanations: E0277, E0599. |
| 90 | +For more information about an error, try `rustc --explain E0277`. |
0 commit comments