]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
modify leak-check to track only outgoing edges from placeholders
[rust.git] / src / test / ui / closure-expected-type / expect-fn-supply-fn.stderr
1 error[E0308]: mismatched types
2   --> $DIR/expect-fn-supply-fn.rs:14:52
3    |
4 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
5    |                                                    ^^^^^^^^^^^ lifetime mismatch
6    |
7    = note: expected fn pointer `fn(&u32)`
8               found fn pointer `fn(&'x u32)`
9 note: the anonymous lifetime #2 defined on the body at 14:48...
10   --> $DIR/expect-fn-supply-fn.rs:14:48
11    |
12 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
13    |                                                ^^^^^^^^^^^^^^^^^^^^^^
14 note: ...does not necessarily outlive the lifetime `'x` as defined on the function body at 11:36
15   --> $DIR/expect-fn-supply-fn.rs:11:36
16    |
17 LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
18    |                                    ^^
19
20 error[E0308]: mismatched types
21   --> $DIR/expect-fn-supply-fn.rs:14:52
22    |
23 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
24    |                                                    ^^^^^^^^^^^ lifetime mismatch
25    |
26    = note: expected fn pointer `fn(&u32)`
27               found fn pointer `fn(&'x u32)`
28 note: the lifetime `'x` as defined on the function body at 11:36...
29   --> $DIR/expect-fn-supply-fn.rs:11:36
30    |
31 LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
32    |                                    ^^
33 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 14:48
34   --> $DIR/expect-fn-supply-fn.rs:14:48
35    |
36 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
37    |                                                ^^^^^^^^^^^^^^^^^^^^^^
38
39 error[E0308]: mismatched types
40   --> $DIR/expect-fn-supply-fn.rs:30:52
41    |
42 LL |     with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
43    |                                                    ^^^^^^^^ one type is more general than the other
44    |
45    = note: expected fn pointer `fn(&u32)`
46               found fn pointer `for<'r> fn(&'r u32)`
47
48 error[E0308]: mismatched types
49   --> $DIR/expect-fn-supply-fn.rs:37:53
50    |
51 LL |     with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
52    |                                                     ^^^^^^^^^^^ one type is more general than the other
53    |
54    = note: expected fn pointer `for<'r> fn(&'r u32)`
55               found fn pointer `fn(&'x u32)`
56
57 error[E0308]: mismatched types
58   --> $DIR/expect-fn-supply-fn.rs:46:53
59    |
60 LL |     with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
61    |                                                     ^^^^^^^ one type is more general than the other
62    |
63    = note: expected fn pointer `for<'r> fn(&'r u32)`
64               found fn pointer `fn(&u32)`
65
66 error: aborting due to 5 previous errors
67
68 For more information about this error, try `rustc --explain E0308`.