1 error[E0308]: mismatched types
2 --> $DIR/closure-reform-bad.rs:11:15
4 LL | let f = |s: &str| println!("{}{}", s, string);
5 | --------- the found closure
7 | --------- ^ expected fn pointer, found closure
9 | arguments to this function are incorrect
11 = note: expected fn pointer `for<'a> fn(&'a str)`
12 found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:22]`
13 note: closures can only be coerced to `fn` types if they do not capture any variables
14 --> $DIR/closure-reform-bad.rs:10:43
16 LL | let f = |s: &str| println!("{}{}", s, string);
17 | ^^^^^^ `string` captured here
18 note: function defined here
19 --> $DIR/closure-reform-bad.rs:4:4
21 LL | fn call_bare(f: fn(&str)) {
22 | ^^^^^^^^^ -----------
24 error: aborting due to previous error
26 For more information about this error, try `rustc --explain E0308`.