1 error[E0308]: `match` arms have incompatible types
2 --> $DIR/closure-no-fn-4.rs:5:18
4 LL | let _: fn(usize) -> usize = match true {
5 | _________________________________-
6 LL | | true => |a| a + 1,
7 | | --------- this is found to be of type `fn(usize) -> usize`
8 LL | | false => |a| a - b,
9 | | ^^^^^^^^^ expected fn pointer, found closure
12 | |_____- `match` arms have incompatible types
14 = note: expected fn pointer `fn(usize) -> usize`
15 found closure `[closure@$DIR/closure-no-fn-4.rs:5:18: 5:21]`
16 note: closures can only be coerced to `fn` types if they do not capture any variables
17 --> $DIR/closure-no-fn-4.rs:5:26
19 LL | false => |a| a - b,
22 error: aborting due to previous error
24 For more information about this error, try `rustc --explain E0308`.