Add test for issue #71176
This commit is contained in:
parent
cbd0d89a26
commit
d328dbc60f
21
src/test/ui/generic-associated-types/issue-71176.rs
Normal file
21
src/test/ui/generic-associated-types/issue-71176.rs
Normal 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(()),
|
||||
};
|
||||
}
|
19
src/test/ui/generic-associated-types/issue-71176.stderr
Normal file
19
src/test/ui/generic-associated-types/issue-71176.stderr
Normal 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`.
|
Loading…
Reference in New Issue
Block a user