LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
| ^^^^^^^^^^^^^
-error[E0308]: mismatched types
+error: implementation of `FnOnce` is not general enough
--> $DIR/closure-arg-type-mismatch.rs:10:5
|
LL | baz(f);
- | ^^^ lifetime mismatch
- |
- = note: expected type `FnOnce<(*mut &u32,)>`
- found type `FnOnce<(*mut &'a u32,)>`
-note: the required lifetime does not necessarily outlive the lifetime `'a` as defined on the function body at 9:10
- --> $DIR/closure-arg-type-mismatch.rs:9:10
- |
-LL | fn _test<'a>(f: fn(*mut &'a u32)) {
- | ^^
-note: the lifetime requirement is introduced here
- --> $DIR/closure-arg-type-mismatch.rs:8:11
+ | ^^^ implementation of `FnOnce` is not general enough
|
-LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
- | ^^^^^^^^^^^^^
+ = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
+ = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
error[E0308]: mismatched types
--> $DIR/closure-arg-type-mismatch.rs:10:5
LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
| ^^^^^^^^^^^^^
-error[E0308]: mismatched types
+error: implementation of `FnOnce` is not general enough
--> $DIR/closure-arg-type-mismatch.rs:10:5
|
LL | baz(f);
- | ^^^ lifetime mismatch
- |
- = note: expected type `FnOnce<(*mut &u32,)>`
- found type `FnOnce<(*mut &'a u32,)>`
-note: the lifetime `'a` as defined on the function body at 9:10 doesn't meet the lifetime requirements
- --> $DIR/closure-arg-type-mismatch.rs:9:10
- |
-LL | fn _test<'a>(f: fn(*mut &'a u32)) {
- | ^^
-note: the lifetime requirement is introduced here
- --> $DIR/closure-arg-type-mismatch.rs:8:11
+ | ^^^ implementation of `FnOnce` is not general enough
|
-LL | fn baz<F: Fn(*mut &u32)>(_: F) {}
- | ^^^^^^^^^^^^^
+ = note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
+ = note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
error: aborting due to 7 previous errors