File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
src/test/ui/generic-associated-types Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 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 number Diff line number Diff line change 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`.
You can’t perform that action at this time.
0 commit comments