File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/test/ui/generic-associated-types Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1- // check-pass
1+ // check-fail
22
33#![ feature( generic_associated_types) ]
44
@@ -16,6 +16,7 @@ impl<T> Foo<T> for () {
1616
1717fn foo < T > ( ) {
1818 let _: for <' a > fn ( <( ) as Foo < T > >:: Type < ' a > , & ' a T ) = |_, _| ( ) ;
19+ //~^ the parameter type `T` may not live long enough
1920}
2021
2122pub fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0311]: the parameter type `T` may not live long enough
2+ --> $DIR/issue-91139.rs:19:12
3+ |
4+ LL | fn foo<T>() {
5+ | - help: consider adding an explicit lifetime bound...: `T: 'a`
6+ LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
7+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
8+
9+ error: aborting due to previous error
10+
You can’t perform that action at this time.
0 commit comments