Skip to content

Commit

Permalink
Add test for issue rust-lang#71176
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Apr 20, 2021
1 parent cbd0d89 commit d328dbc
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/generic-associated-types/issue-71176.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 19 additions & 0 deletions src/test/ui/generic-associated-types/issue-71176.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit d328dbc

Please sign in to comment.