From e8fc076f231699d9a44fc44a1e298ea4f70fdb48 Mon Sep 17 00:00:00 2001 From: Esteban Kuber Date: Tue, 28 Sep 2021 14:48:54 +0000 Subject: 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. --- src/test/ui/methods/method-call-err-msg.stderr | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/test/ui/methods') 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` -- cgit 1.4.1-3-g733a5