mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00

When encountering an unmet trait bound, point at local type that doesn't implement the trait: ``` error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied --> $DIR/issue-64855.rs:9:19 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `Foo` is not implemented for `Bar<T>` --> $DIR/issue-64855.rs:9:1 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^ ```
80 lines
2.9 KiB
Plaintext
80 lines
2.9 KiB
Plaintext
error[E0277]: the trait bound `NonImplementedStruct: NonImplementedTrait` is not satisfied in `ADecoder<'a>`
|
|
--> $DIR/dropck-normalize-errors.rs:19:28
|
|
|
|
|
LL | fn make_a_decoder<'a>() -> ADecoder<'a> {
|
|
| ^^^^^^^^^^^^ unsatisfied trait bound
|
|
|
|
|
help: within `ADecoder<'a>`, the trait `NonImplementedTrait` is not implemented for `NonImplementedStruct`
|
|
--> $DIR/dropck-normalize-errors.rs:14:1
|
|
|
|
|
LL | struct NonImplementedStruct;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: this trait has no implementations, consider adding one
|
|
--> $DIR/dropck-normalize-errors.rs:11:1
|
|
|
|
|
LL | trait NonImplementedTrait {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: required because it appears within the type `BDecoder`
|
|
--> $DIR/dropck-normalize-errors.rs:30:12
|
|
|
|
|
LL | pub struct BDecoder {
|
|
| ^^^^^^^^
|
|
note: required because it appears within the type `ADecoder<'a>`
|
|
--> $DIR/dropck-normalize-errors.rs:16:12
|
|
|
|
|
LL | pub struct ADecoder<'a> {
|
|
| ^^^^^^^^
|
|
= note: the return type of a function must have a statically known size
|
|
|
|
error[E0277]: the trait bound `NonImplementedStruct: NonImplementedTrait` is not satisfied in `BDecoder`
|
|
--> $DIR/dropck-normalize-errors.rs:27:20
|
|
|
|
|
LL | type Decoder = BDecoder;
|
|
| ^^^^^^^^ unsatisfied trait bound
|
|
|
|
|
help: within `BDecoder`, the trait `NonImplementedTrait` is not implemented for `NonImplementedStruct`
|
|
--> $DIR/dropck-normalize-errors.rs:14:1
|
|
|
|
|
LL | struct NonImplementedStruct;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: this trait has no implementations, consider adding one
|
|
--> $DIR/dropck-normalize-errors.rs:11:1
|
|
|
|
|
LL | trait NonImplementedTrait {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
note: required because it appears within the type `BDecoder`
|
|
--> $DIR/dropck-normalize-errors.rs:30:12
|
|
|
|
|
LL | pub struct BDecoder {
|
|
| ^^^^^^^^
|
|
note: required by a bound in `Decode::Decoder`
|
|
--> $DIR/dropck-normalize-errors.rs:8:5
|
|
|
|
|
LL | type Decoder;
|
|
| ^^^^^^^^^^^^^ required by this bound in `Decode::Decoder`
|
|
help: consider relaxing the implicit `Sized` restriction
|
|
|
|
|
LL | type Decoder: ?Sized;
|
|
| ++++++++
|
|
|
|
error[E0277]: the trait bound `NonImplementedStruct: NonImplementedTrait` is not satisfied
|
|
--> $DIR/dropck-normalize-errors.rs:31:22
|
|
|
|
|
LL | non_implemented: <NonImplementedStruct as NonImplementedTrait>::Assoc,
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
|
|
|
|
|
help: the trait `NonImplementedTrait` is not implemented for `NonImplementedStruct`
|
|
--> $DIR/dropck-normalize-errors.rs:14:1
|
|
|
|
|
LL | struct NonImplementedStruct;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: this trait has no implementations, consider adding one
|
|
--> $DIR/dropck-normalize-errors.rs:11:1
|
|
|
|
|
LL | trait NonImplementedTrait {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|