]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
Rollup merge of #105758 - Nilstrieb:typeck-results-mod, r=compiler-errors
[rust.git] / src / test / ui / closure-expected-type / expect-fn-supply-fn.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 error[E0308]: mismatched types
23   --> $DIR/expect-fn-supply-fn.rs:32:49
24    |
25 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 `fn(&u32)`
29               found fn pointer `for<'a> fn(&'a u32)`
30
31 error[E0308]: mismatched types
32   --> $DIR/expect-fn-supply-fn.rs:39:50
33    |
34 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 `for<'a> fn(&'a u32)`
38               found fn pointer `fn(&u32)`
39
40 error[E0308]: mismatched types
41   --> $DIR/expect-fn-supply-fn.rs:48:50
42    |
43 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 `for<'a> fn(&'a u32)`
47               found fn pointer `fn(&u32)`
48
49 error: aborting due to 5 previous errors
50
51 For more information about this error, try `rustc --explain E0308`.