mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
Add test for issue #78671
This commit is contained in:
parent
19e51aaef7
commit
25cb1af7b2
14
src/test/ui/generic-associated-types/issue-78671.rs
Normal file
14
src/test/ui/generic-associated-types/issue-78671.rs
Normal file
@ -0,0 +1,14 @@
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(generic_associated_types)]
|
||||
|
||||
trait CollectionFamily {
|
||||
type Member<T>;
|
||||
//~^ ERROR: missing generics for associated type
|
||||
}
|
||||
fn floatify() {
|
||||
Box::new(Family) as &dyn CollectionFamily<Member=usize>
|
||||
}
|
||||
|
||||
struct Family;
|
||||
|
||||
fn main() {}
|
19
src/test/ui/generic-associated-types/issue-78671.stderr
Normal file
19
src/test/ui/generic-associated-types/issue-78671.stderr
Normal file
@ -0,0 +1,19 @@
|
||||
error[E0107]: missing generics for associated type `CollectionFamily::Member`
|
||||
--> $DIR/issue-78671.rs:5:10
|
||||
|
|
||||
LL | type Member<T>;
|
||||
| ^^^^^^ expected 1 type argument
|
||||
|
|
||||
note: associated type defined here, with 1 type parameter: `T`
|
||||
--> $DIR/issue-78671.rs:5:10
|
||||
|
|
||||
LL | type Member<T>;
|
||||
| ^^^^^^ -
|
||||
help: use angle brackets to add missing type argument
|
||||
|
|
||||
LL | type Member<T><T>;
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0107`.
|
Loading…
Reference in New Issue
Block a user