1 error[E0308]: mismatched types
2 --> $DIR/expect-fn-supply-fn.rs:14:52
4 LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
5 | ^^^^^^^^^^^ lifetime mismatch
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
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
17 LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
20 error[E0308]: mismatched types
21 --> $DIR/expect-fn-supply-fn.rs:14:52
23 LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
24 | ^^^^^^^^^^^ lifetime mismatch
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
31 LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
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
36 LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
37 | ^^^^^^^^^^^^^^^^^^^^^^
39 error[E0308]: mismatched types
40 --> $DIR/expect-fn-supply-fn.rs:30:52
42 LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
43 | ^^^^^^^^ one type is more general than the other
45 = note: expected fn pointer `fn(&u32)`
46 found fn pointer `for<'r> fn(&'r u32)`
48 error[E0308]: mismatched types
49 --> $DIR/expect-fn-supply-fn.rs:37:53
51 LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
52 | ^^^^^^^^^^^ one type is more general than the other
54 = note: expected fn pointer `for<'r> fn(&'r u32)`
55 found fn pointer `fn(&'x u32)`
57 error[E0308]: mismatched types
58 --> $DIR/expect-fn-supply-fn.rs:46:53
60 LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
61 | ^^^^^^^ one type is more general than the other
63 = note: expected fn pointer `for<'r> fn(&'r u32)`
64 found fn pointer `fn(&u32)`
66 error: aborting due to 5 previous errors
68 For more information about this error, try `rustc --explain E0308`.