about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-07-11 06:53:01 +0000
committerMichael Goulet <michael@errs.io>2022-07-11 06:53:11 +0000
commit680fef4d0455449d2226f8b9a4b266cc5c82ccc0 (patch)
treefe83f7d38777276436796343b69a67370ece121a /src
parentc396bb3b8a16b1f2762b7c6078dc3e023f6a2493 (diff)
downloadrust-680fef4d0455449d2226f8b9a4b266cc5c82ccc0.tar.gz
rust-680fef4d0455449d2226f8b9a4b266cc5c82ccc0.zip
Mention similarly named associated type even if it's not clearly in supertrait
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/resolve/issue-55673.rs12
-rw-r--r--src/test/ui/resolve/issue-55673.stderr9
-rw-r--r--src/test/ui/traits/issue-59029-1.stderr4
-rw-r--r--src/test/ui/type-alias-impl-trait/not_well_formed.stderr2
4 files changed, 24 insertions, 3 deletions
diff --git a/src/test/ui/resolve/issue-55673.rs b/src/test/ui/resolve/issue-55673.rs
new file mode 100644
index 00000000000..0436bd39742
--- /dev/null
+++ b/src/test/ui/resolve/issue-55673.rs
@@ -0,0 +1,12 @@
+trait Foo {
+    type Bar;
+}
+
+fn foo<T: Foo>()
+where
+    T::Baa: std::fmt::Debug,
+    //~^ ERROR associated type `Baa` not found for `T`
+{
+}
+
+fn main() {}
diff --git a/src/test/ui/resolve/issue-55673.stderr b/src/test/ui/resolve/issue-55673.stderr
new file mode 100644
index 00000000000..39318f95905
--- /dev/null
+++ b/src/test/ui/resolve/issue-55673.stderr
@@ -0,0 +1,9 @@
+error[E0220]: associated type `Baa` not found for `T`
+  --> $DIR/issue-55673.rs:7:8
+   |
+LL |     T::Baa: std::fmt::Debug,
+   |        ^^^ there is a similarly named associated type `Bar` in the trait `Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0220`.
diff --git a/src/test/ui/traits/issue-59029-1.stderr b/src/test/ui/traits/issue-59029-1.stderr
index 53cdb8b1baf..203a8928530 100644
--- a/src/test/ui/traits/issue-59029-1.stderr
+++ b/src/test/ui/traits/issue-59029-1.stderr
@@ -2,13 +2,13 @@ error[E0220]: associated type `Res` not found for `Self`
   --> $DIR/issue-59029-1.rs:5:52
    |
 LL | trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
-   |                                                    ^^^ associated type `Res` not found
+   |                                                    ^^^ there is a similarly named associated type `Res` in the trait `Svc`
 
 error[E0220]: associated type `Res` not found for `Self`
   --> $DIR/issue-59029-1.rs:5:52
    |
 LL | trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
-   |                                                    ^^^ associated type `Res` not found
+   |                                                    ^^^ there is a similarly named associated type `Res` in the trait `Svc`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.stderr b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
index 91c1d031e4e..c36b95f47e8 100644
--- a/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
+++ b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
@@ -2,7 +2,7 @@ error[E0220]: associated type `Assoc` not found for `V`
   --> $DIR/not_well_formed.rs:9:29
    |
 LL | type Foo<V> = impl Trait<V::Assoc>;
-   |                             ^^^^^ associated type `Assoc` not found
+   |                             ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
 
 error: aborting due to previous error