Skip to content

Commit 25cb1af

Browse files
committed
Add test for issue #78671
1 parent 19e51aa commit 25cb1af

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![allow(incomplete_features)]
2+
#![feature(generic_associated_types)]
3+
4+
trait CollectionFamily {
5+
type Member<T>;
6+
//~^ ERROR: missing generics for associated type
7+
}
8+
fn floatify() {
9+
Box::new(Family) as &dyn CollectionFamily<Member=usize>
10+
}
11+
12+
struct Family;
13+
14+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0107]: missing generics for associated type `CollectionFamily::Member`
2+
--> $DIR/issue-78671.rs:5:10
3+
|
4+
LL | type Member<T>;
5+
| ^^^^^^ expected 1 type argument
6+
|
7+
note: associated type defined here, with 1 type parameter: `T`
8+
--> $DIR/issue-78671.rs:5:10
9+
|
10+
LL | type Member<T>;
11+
| ^^^^^^ -
12+
help: use angle brackets to add missing type argument
13+
|
14+
LL | type Member<T><T>;
15+
| ^^^
16+
17+
error: aborting due to previous error
18+
19+
For more information about this error, try `rustc --explain E0107`.

0 commit comments

Comments
 (0)