Add test for issue #71176

This commit is contained in:
marmeladema 2021-04-21 00:07:42 +01:00
parent cbd0d89a26
commit d328dbc60f
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#![allow(incomplete_features)]
#![feature(generic_associated_types)]
trait Provider {
type A<'a>;
//~^ ERROR: missing generics for associated type
}
impl Provider for () {
type A<'a> = ();
}
struct Holder<B> {
inner: Box<dyn Provider<A = B>>,
}
fn main() {
Holder {
inner: Box::new(()),
};
}

View File

@ -0,0 +1,19 @@
error[E0107]: missing generics for associated type `Provider::A`
--> $DIR/issue-71176.rs:5:10
|
LL | type A<'a>;
| ^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
--> $DIR/issue-71176.rs:5:10
|
LL | type A<'a>;
| ^ --
help: use angle brackets to add missing lifetime argument
|
LL | type A<'a><'a>;
| ^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0107`.