|
1 |
| -error[E0631]: type mismatch in closure arguments |
2 |
| - --> $DIR/expect-fn-supply-fn.rs:30:5 |
| 1 | +error: lifetime may not live long enough |
| 2 | + --> $DIR/expect-fn-supply-fn.rs:16:49 |
3 | 3 | |
|
4 |
| -LL | fn with_closure_expecting_fn_with_free_region<F>(_: F) |
5 |
| - | ------------------------------------------ required by a bound in this |
6 |
| -LL | where F: for<'a> FnOnce(fn(&'a u32), &i32) |
7 |
| - | ------------------------- required by this bound in `with_closure_expecting_fn_with_free_region` |
| 4 | +LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { |
| 5 | + | -- lifetime `'x` defined here |
8 | 6 | ...
|
9 |
| -LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); |
10 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _` |
11 |
| - | | |
12 |
| - | expected signature of `fn(fn(&'a u32), &i32) -> _` |
| 7 | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); |
| 8 | + | ^ |
| 9 | + | | |
| 10 | + | has type `fn(&'1 u32)` |
| 11 | + | requires that `'1` must outlive `'x` |
13 | 12 |
|
14 |
| -error[E0631]: type mismatch in closure arguments |
15 |
| - --> $DIR/expect-fn-supply-fn.rs:37:5 |
| 13 | +error: lifetime may not live long enough |
| 14 | + --> $DIR/expect-fn-supply-fn.rs:16:49 |
16 | 15 | |
|
17 |
| -LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F) |
18 |
| - | ------------------------------------------- required by a bound in this |
19 |
| -LL | where F: FnOnce(fn(&u32), &i32) |
20 |
| - | ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region` |
| 16 | +LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { |
| 17 | + | -- lifetime `'x` defined here |
21 | 18 | ...
|
| 19 | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); |
| 20 | + | ^ requires that `'x` must outlive `'static` |
| 21 | + | |
| 22 | + = help: consider replacing `'x` with `'static` |
| 23 | + |
| 24 | +error: higher-ranked subtype error |
| 25 | + --> $DIR/expect-fn-supply-fn.rs:32:49 |
| 26 | + | |
| 27 | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); |
| 28 | + | ^ |
| 29 | + |
| 30 | +error: higher-ranked subtype error |
| 31 | + --> $DIR/expect-fn-supply-fn.rs:39:50 |
| 32 | + | |
22 | 33 | LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
|
23 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _` |
24 |
| - | | |
25 |
| - | expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _` |
| 34 | + | ^ |
26 | 35 |
|
27 |
| -error[E0631]: type mismatch in closure arguments |
28 |
| - --> $DIR/expect-fn-supply-fn.rs:46:5 |
| 36 | +error: higher-ranked subtype error |
| 37 | + --> $DIR/expect-fn-supply-fn.rs:48:50 |
29 | 38 | |
|
30 |
| -LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F) |
31 |
| - | ------------------------------------------- required by a bound in this |
32 |
| -LL | where F: FnOnce(fn(&u32), &i32) |
33 |
| - | ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region` |
34 |
| -... |
35 | 39 | LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
|
36 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _` |
37 |
| - | | |
38 |
| - | expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _` |
| 40 | + | ^ |
39 | 41 |
|
40 |
| -error: aborting due to 3 previous errors |
| 42 | +error: aborting due to 5 previous errors |
41 | 43 |
|
42 |
| -For more information about this error, try `rustc --explain E0631`. |
|
0 commit comments