-error[E0308]: mismatched types
- --> $DIR/issue-30906.rs:15:5
+error: implementation of `FnOnce` is not general enough
+ --> $DIR/issue-30906.rs:18:5
|
LL | test(Compose(f, |_| {}));
- | ^^^^ lifetime mismatch
+ | ^^^^ implementation of `FnOnce` is not general enough
|
- = note: expected type `FnOnce<(&'x str,)>`
- found type `FnOnce<(&str,)>`
-note: the lifetime requirement is introduced here
- --> $DIR/issue-30906.rs:3:12
- |
-LL | fn test<F: for<'x> FnOnce<(&'x str,)>>(_: F) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: `fn(&'2 str) -> T` must implement `FnOnce<(&'1 str,)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&'2 str,)>`, for some specific lifetime `'2`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0308`.