]> git.lizzy.rs Git - rust.git/blob - src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr
Rollup merge of #84083 - ltratt:threadid_doc_tweak, r=dtolnay
[rust.git] / src / test / ui / missing-trait-bounds / missing-trait-bounds-for-method-call.stderr
1 error[E0599]: the method `foo` exists for reference `&Foo<T>`, but its trait bounds were not satisfied
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();
8    |              ^^^ method cannot be called on `&Foo<T>` due to unsatisfied trait bounds
9    |
10    = note: the following trait bounds were not satisfied:
11            `T: Default`
12            which is required by `Foo<T>: Bar`
13            `T: Bar`
14            which is required by `Foo<T>: Bar`
15 help: consider restricting the type parameters to satisfy the trait bounds
16    |
17 LL | struct Foo<T> where T: Bar, T: Default {
18    |               ++++++++++++++++++++++++
19
20 error[E0599]: the method `foo` exists for reference `&Fin<T>`, but its trait bounds were not satisfied
21   --> $DIR/missing-trait-bounds-for-method-call.rs:27:14
22    |
23 LL | struct Fin<T> where T: Bar {
24    | -------------------------- doesn't satisfy `Fin<T>: Bar`
25 ...
26 LL |         self.foo();
27    |              ^^^ method cannot be called on `&Fin<T>` due to unsatisfied trait bounds
28    |
29    = note: the following trait bounds were not satisfied:
30            `T: Default`
31            which is required by `Fin<T>: Bar`
32 help: consider restricting the type parameter to satisfy the trait bound
33    |
34 LL | struct Fin<T> where T: Bar, T: Default {
35    |                           ++++++++++++
36
37 error: aborting due to 2 previous errors
38
39 For more information about this error, try `rustc --explain E0599`.