1 error[E0310]: the parameter type `T` may not live long enough
2 --> $DIR/issue_74400.rs:12:5
5 | ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
7 help: consider adding an explicit lifetime bound...
9 LL | fn g<T: 'static>(data: &[T]) {
12 error[E0308]: mismatched types
13 --> $DIR/issue_74400.rs:12:5
15 LL | f(data, identity)
16 | ^^^^^^^^^^^^^^^^^ one type is more general than the other
18 = note: expected trait `for<'a> Fn<(&'a T,)>`
19 found trait `Fn<(&T,)>`
20 note: the lifetime requirement is introduced here
21 --> $DIR/issue_74400.rs:8:34
23 LL | fn f<T, S>(data: &[T], key: impl Fn(&T) -> S) {
26 error: implementation of `FnOnce` is not general enough
27 --> $DIR/issue_74400.rs:12:5
29 LL | f(data, identity)
30 | ^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
32 = note: `fn(&'2 T) -> &'2 T {identity::<&'2 T>}` must implement `FnOnce<(&'1 T,)>`, for any lifetime `'1`...
33 = note: ...but it actually implements `FnOnce<(&'2 T,)>`, for some specific lifetime `'2`
35 error: aborting due to 3 previous errors
37 Some errors have detailed explanations: E0308, E0310.
38 For more information about an error, try `rustc --explain E0308`.