diff --git a/src/test/rustdoc-ui/issue-96287.rs b/src/test/rustdoc-ui/issue-96287.rs new file mode 100644 index 0000000000000..8d8b4456e6335 --- /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 = impl Trait; +//~^ ERROR +//~^^ ERROR + +pub trait Trait {} + +impl Trait for () {} + +pub fn foo_desugared(_: T) -> Foo { + () +} diff --git a/src/test/rustdoc-ui/issue-96287.stderr b/src/test/rustdoc-ui/issue-96287.stderr new file mode 100644 index 0000000000000..0236b9fe64775 --- /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 = impl Trait; + | ^^^^^ 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 = impl Trait; + | ^^^^^ 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`.