fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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