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
2
2
3
3
#![ feature( generic_associated_types) ]
4
4
@@ -16,6 +16,7 @@ impl<T> Foo<T> for () {
16
16
17
17
fn foo < T > ( ) {
18
18
let _: for <' a > fn ( <( ) as Foo < T > >:: Type < ' a > , & ' a T ) = |_, _| ( ) ;
19
+ //~^ the parameter type `T` may not live long enough
19
20
}
20
21
21
22
pub 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