LL | self.foo();
| ^^^ method cannot be called on `&Foo<T>` due to unsatisfied trait bounds
|
- = note: the following trait bounds were not satisfied:
- `T: Default`
- which is required by `Foo<T>: Bar`
- `T: Bar`
- which is required by `Foo<T>: Bar`
+note: trait bound `T: Default` was not satisfied
+ --> $DIR/missing-trait-bounds-for-method-call.rs:10:9
+ |
+LL | impl<T: Default + Bar> Bar for Foo<T> {}
+ | ^^^^^^^ --- ------
+ | |
+ | unsatisfied trait bound introduced here
+note: trait bound `T: Bar` was not satisfied
+ --> $DIR/missing-trait-bounds-for-method-call.rs:10:19
+ |
+LL | impl<T: Default + Bar> Bar for Foo<T> {}
+ | ^^^ --- ------
+ | |
+ | unsatisfied trait bound introduced here
help: consider restricting the type parameters to satisfy the trait bounds
|
LL | struct Foo<T> where T: Bar, T: Default {
LL | self.foo();
| ^^^ method cannot be called on `&Fin<T>` due to unsatisfied trait bounds
|
- = note: the following trait bounds were not satisfied:
- `T: Default`
- which is required by `Fin<T>: Bar`
+note: trait bound `T: Default` was not satisfied
+ --> $DIR/missing-trait-bounds-for-method-call.rs:23:9
+ |
+LL | impl<T: Default + Bar> Bar for Fin<T> {}
+ | ^^^^^^^ --- ------
+ | |
+ | unsatisfied trait bound introduced here
help: consider restricting the type parameter to satisfy the trait bound
|
LL | struct Fin<T> where T: Bar, T: Default {