error[E0599]: no method named `foo` found for reference `&Foo` in the current scope --> $DIR/missing-trait-bounds-for-method-call.rs:14:14 | LL | struct Foo { | ------------- doesn't satisfy `Foo: Bar` ... LL | self.foo(); | ^^^ method not found in `&Foo` | = note: the method `foo` exists but the following trait bounds were not satisfied: `T: Bar` which is required by `Foo: Bar` `T: std::default::Default` which is required by `Foo: Bar` help: consider restricting the type parameters to satisfy the trait bounds | LL | struct Foo where T: Bar, T: std::default::Default { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0599]: no method named `foo` found for reference `&Fin` in the current scope --> $DIR/missing-trait-bounds-for-method-call.rs:27:14 | LL | struct Fin where T: Bar { | -------------------------- doesn't satisfy `Fin: Bar` ... LL | self.foo(); | ^^^ method not found in `&Fin` | = note: the method `foo` exists but the following trait bounds were not satisfied: `T: std::default::Default` which is required by `Fin: Bar` help: consider restricting the type parameter to satisfy the trait bound | LL | struct Fin where T: Bar, T: std::default::Default { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0599`.