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