]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / closure-expected-type / expect-fn-supply-fn.nll.stderr
1 error: lifetime may not live long enough
2 --> $DIR/expect-fn-supply-fn.rs:16: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:16: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 = help: consider replacing `'x` with `'static`
23
24 error[E0308]: mismatched types
25 --> $DIR/expect-fn-supply-fn.rs:32:49
26 |
27 LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
28 | ^ one type is more general than the other
29 |
30 = note: expected fn pointer `for<'r> fn(&'r u32)`
31 found fn pointer `fn(&u32)`
32
33 error[E0308]: mismatched types
34 --> $DIR/expect-fn-supply-fn.rs:39:50
35 |
36 LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
37 | ^ one type is more general than the other
38 |
39 = note: expected fn pointer `fn(&'x u32)`
40 found fn pointer `for<'r> fn(&'r u32)`
41
42 error[E0308]: mismatched types
43 --> $DIR/expect-fn-supply-fn.rs:48:50
44 |
45 LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
46 | ^ one type is more general than the other
47 |
48 = note: expected fn pointer `fn(&u32)`
49 found fn pointer `for<'r> fn(&'r u32)`
50
51 error: aborting due to 5 previous errors
52
53 For more information about this error, try `rustc --explain E0308`.