Skip to content

Commit d328dbc

Browse files
committed
Add test for issue rust-lang#71176
1 parent cbd0d89 commit d328dbc

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#![allow(incomplete_features)]
2+
#![feature(generic_associated_types)]
3+
4+
trait Provider {
5+
type A<'a>;
6+
//~^ ERROR: missing generics for associated type
7+
}
8+
9+
impl Provider for () {
10+
type A<'a> = ();
11+
}
12+
13+
struct Holder<B> {
14+
inner: Box<dyn Provider<A = B>>,
15+
}
16+
17+
fn main() {
18+
Holder {
19+
inner: Box::new(()),
20+
};
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0107]: missing generics for associated type `Provider::A`
2+
--> $DIR/issue-71176.rs:5:10
3+
|
4+
LL | type A<'a>;
5+
| ^ expected 1 lifetime argument
6+
|
7+
note: associated type defined here, with 1 lifetime parameter: `'a`
8+
--> $DIR/issue-71176.rs:5:10
9+
|
10+
LL | type A<'a>;
11+
| ^ --
12+
help: use angle brackets to add missing lifetime argument
13+
|
14+
LL | type A<'a><'a>;
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)