about summary refs log tree commit diff
path: root/src/test/ui/specialization/defaultimpl
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/specialization/defaultimpl
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/specialization/defaultimpl')
-rw-r--r--src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr
index 16ffc661fe0..ce981bc0098 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr
@@ -22,6 +22,14 @@ LL |     println!("{}", MyStruct.foo_one());
    |
    = note: the following trait bounds were not satisfied:
            `MyStruct: Foo`
+note: the following trait must be implemented
+  --> $DIR/specialization-trait-not-implemented.rs:7:1
+   |
+LL | / trait Foo {
+LL | |     fn foo_one(&self) -> &'static str;
+LL | |     fn foo_two(&self) -> &'static str;
+LL | | }
+   | |_^
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `Foo` defines an item `foo_one`, perhaps you need to implement it
   --> $DIR/specialization-trait-not-implemented.rs:7:1