]>
Commit | Line | Data |
---|---|---|
5869c6ff | 1 | error[E0599]: the method `foo` exists for reference `&Foo<T>`, but its trait bounds were not satisfied |
74b04a01 XL |
2 | --> $DIR/missing-trait-bounds-for-method-call.rs:14:14 |
3 | | | |
4 | LL | struct Foo<T> { | |
5 | | ------------- doesn't satisfy `Foo<T>: Bar` | |
6 | ... | |
7 | LL | self.foo(); | |
5869c6ff | 8 | | ^^^ method cannot be called on `&Foo<T>` due to unsatisfied trait bounds |
74b04a01 | 9 | | |
ee023bcb FG |
10 | note: trait bound `T: Default` was not satisfied |
11 | --> $DIR/missing-trait-bounds-for-method-call.rs:10:9 | |
12 | | | |
13 | LL | impl<T: Default + Bar> Bar for Foo<T> {} | |
14 | | ^^^^^^^ --- ------ | |
15 | | | | |
16 | | unsatisfied trait bound introduced here | |
17 | note: trait bound `T: Bar` was not satisfied | |
18 | --> $DIR/missing-trait-bounds-for-method-call.rs:10:19 | |
19 | | | |
20 | LL | impl<T: Default + Bar> Bar for Foo<T> {} | |
21 | | ^^^ --- ------ | |
22 | | | | |
23 | | unsatisfied trait bound introduced here | |
74b04a01 XL |
24 | help: consider restricting the type parameters to satisfy the trait bounds |
25 | | | |
1b1a35ee | 26 | LL | struct Foo<T> where T: Bar, T: Default { |
94222f64 | 27 | | ++++++++++++++++++++++++ |
74b04a01 | 28 | |
5869c6ff | 29 | error[E0599]: the method `foo` exists for reference `&Fin<T>`, but its trait bounds were not satisfied |
74b04a01 XL |
30 | --> $DIR/missing-trait-bounds-for-method-call.rs:27:14 |
31 | | | |
32 | LL | struct Fin<T> where T: Bar { | |
33 | | -------------------------- doesn't satisfy `Fin<T>: Bar` | |
34 | ... | |
35 | LL | self.foo(); | |
5869c6ff | 36 | | ^^^ method cannot be called on `&Fin<T>` due to unsatisfied trait bounds |
74b04a01 | 37 | | |
ee023bcb FG |
38 | note: trait bound `T: Default` was not satisfied |
39 | --> $DIR/missing-trait-bounds-for-method-call.rs:23:9 | |
40 | | | |
41 | LL | impl<T: Default + Bar> Bar for Fin<T> {} | |
42 | | ^^^^^^^ --- ------ | |
43 | | | | |
44 | | unsatisfied trait bound introduced here | |
74b04a01 XL |
45 | help: consider restricting the type parameter to satisfy the trait bound |
46 | | | |
1b1a35ee | 47 | LL | struct Fin<T> where T: Bar, T: Default { |
94222f64 | 48 | | ++++++++++++ |
74b04a01 XL |
49 | |
50 | error: aborting due to 2 previous errors | |
51 | ||
52 | For more information about this error, try `rustc --explain E0599`. |