]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/missing-trait-bounds/missing-trait-bounds-for-method-call.stderr
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / missing-trait-bounds / missing-trait-bounds-for-method-call.stderr
index 2f0fd692a444a23648e85ed22d6bd9b692937842..f3c6b39e62ed0fc9b406edb56f2a7c21d394b230 100644 (file)
@@ -7,11 +7,20 @@ LL | struct Foo<T> {
 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 {
@@ -26,9 +35,13 @@ LL | struct Fin<T> where T: Bar {
 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 {