blob: 003339584681529f296a311586e29e05d6c8f1d4 [file] [log] [blame]
error[E0308]: mismatched types
--> $DIR/expect-fn-supply-fn.rs:14:52
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^ lifetime mismatch
|
= note: expected fn pointer `fn(&u32)`
found fn pointer `fn(&'x u32)`
note: the anonymous lifetime #2 defined on the body at 14:48...
--> $DIR/expect-fn-supply-fn.rs:14:48
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^
note: ...does not necessarily outlive the lifetime `'x` as defined on the function body at 11:36
--> $DIR/expect-fn-supply-fn.rs:11:36
|
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
| ^^
error[E0308]: mismatched types
--> $DIR/expect-fn-supply-fn.rs:14:52
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^ lifetime mismatch
|
= note: expected fn pointer `fn(&u32)`
found fn pointer `fn(&'x u32)`
note: the lifetime `'x` as defined on the function body at 11:36...
--> $DIR/expect-fn-supply-fn.rs:11:36
|
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
| ^^
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 14:48
--> $DIR/expect-fn-supply-fn.rs:14:48
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:30:5
|
LL | fn with_closure_expecting_fn_with_free_region<F>(_: F)
| ------------------------------------------
LL | where F: for<'a> FnOnce(fn(&'a u32), &i32)
| ------------------------- required by this bound in `with_closure_expecting_fn_with_free_region`
...
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _`
| |
| expected signature of `fn(fn(&'a u32), &i32) -> _`
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:37:5
|
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| -------------------------------------------
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
...
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:46:5
|
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| -------------------------------------------
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
...
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0308, E0631.
For more information about an error, try `rustc --explain E0308`.