about summary refs log tree commit diff
path: root/src/test/ui/methods
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2021-09-28 14:48:54 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2021-10-05 23:34:13 +0000
commite8fc076f231699d9a44fc44a1e298ea4f70fdb48 (patch)
treec4d83e0d4aa46d9c82d90f2cb50c98322ce5dafa /src/test/ui/methods
parent074f63648bd2368d5ca19aed02b5763a144e5d05 (diff)
downloadrust-e8fc076f231699d9a44fc44a1e298ea4f70fdb48.tar.gz
rust-e8fc076f231699d9a44fc44a1e298ea4f70fdb48.zip
Consider unfulfilled obligations in binop errors
When encountering a binop where the types would have been accepted, if
all the predicates had been fulfilled, include information about the
predicates and suggest appropriate `#[derive]`s if possible.

Point at trait(s) that needs to be `impl`emented.
Diffstat (limited to 'src/test/ui/methods')
-rw-r--r--src/test/ui/methods/method-call-err-msg.stderr11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr
index ffeacfe15dd..c1183e053eb 100644
--- a/src/test/ui/methods/method-call-err-msg.stderr
+++ b/src/test/ui/methods/method-call-err-msg.stderr
@@ -55,6 +55,17 @@ LL |      .take()
    = note: the following trait bounds were not satisfied:
            `Foo: Iterator`
            which is required by `&mut Foo: Iterator`
+note: the following trait must be implemented
+  --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+   |
+LL | / pub trait Iterator {
+LL | |     /// The type of the elements being iterated over.
+LL | |     #[stable(feature = "rust1", since = "1.0.0")]
+LL | |     type Item;
+...  |
+LL | |     }
+LL | | }
+   | |_^
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `take`, perhaps you need to implement it:
            candidate #1: `Iterator`