Skip to content

Commit c156773

Browse files
Add regression test for #96287
1 parent a167435 commit c156773

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/test/rustdoc-ui/issue-96287.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
pub trait TraitWithAssoc {
4+
type Assoc;
5+
}
6+
7+
pub type Foo<V> = impl Trait<V::Assoc>;
8+
//~^ ERROR
9+
//~^^ ERROR
10+
11+
pub trait Trait<U> {}
12+
13+
impl<W> Trait<W> for () {}
14+
15+
pub fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T> {
16+
()
17+
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0220]: associated type `Assoc` not found for `V`
2+
--> $DIR/issue-96287.rs:7:33
3+
|
4+
LL | pub type Foo<V> = impl Trait<V::Assoc>;
5+
| ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
6+
7+
error[E0220]: associated type `Assoc` not found for `V`
8+
--> $DIR/issue-96287.rs:7:33
9+
|
10+
LL | pub type Foo<V> = impl Trait<V::Assoc>;
11+
| ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
12+
13+
error: aborting due to 2 previous errors
14+
15+
For more information about this error, try `rustc --explain E0220`.

0 commit comments

Comments
 (0)