about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-01-02 14:29:56 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-01-02 14:49:08 +0100
commitc1567730c0ea07e41fcabd14332ad701857d9f93 (patch)
treebb385cb45b502c197761f45f7f2d924a80e05948 /src
parenta167435b76c1070fa0290e27f7756c9bb5b6548b (diff)
downloadrust-c1567730c0ea07e41fcabd14332ad701857d9f93.tar.gz
rust-c1567730c0ea07e41fcabd14332ad701857d9f93.zip
Add regression test for #96287
Diffstat (limited to 'src')
-rw-r--r--src/test/rustdoc-ui/issue-96287.rs17
-rw-r--r--src/test/rustdoc-ui/issue-96287.stderr15
2 files changed, 32 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/issue-96287.rs b/src/test/rustdoc-ui/issue-96287.rs
new file mode 100644
index 00000000000..8d8b4456e63
--- /dev/null
+++ b/src/test/rustdoc-ui/issue-96287.rs
@@ -0,0 +1,17 @@
+#![feature(type_alias_impl_trait)]
+
+pub trait TraitWithAssoc {
+    type Assoc;
+}
+
+pub type Foo<V> = impl Trait<V::Assoc>;
+//~^ ERROR
+//~^^ ERROR
+
+pub trait Trait<U> {}
+
+impl<W> Trait<W> for () {}
+
+pub fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T> {
+    ()
+}
diff --git a/src/test/rustdoc-ui/issue-96287.stderr b/src/test/rustdoc-ui/issue-96287.stderr
new file mode 100644
index 00000000000..0236b9fe647
--- /dev/null
+++ b/src/test/rustdoc-ui/issue-96287.stderr
@@ -0,0 +1,15 @@
+error[E0220]: associated type `Assoc` not found for `V`
+  --> $DIR/issue-96287.rs:7:33
+   |
+LL | pub type Foo<V> = impl Trait<V::Assoc>;
+   |                                 ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
+
+error[E0220]: associated type `Assoc` not found for `V`
+  --> $DIR/issue-96287.rs:7:33
+   |
+LL | pub type Foo<V> = impl Trait<V::Assoc>;
+   |                                 ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0220`.