64 lines
1.9 KiB
Plaintext
64 lines
1.9 KiB
Plaintext
|
error[E0308]: mismatched types
|
||
|
--> $DIR/issue-24036.rs:13:9
|
||
|
|
|
||
|
13 | x = |c| c + 1;
|
||
|
| ^^^^^^^^^ expected closure, found a different closure
|
||
|
|
|
||
|
= note: expected type `[closure@$DIR/issue-24036.rs:12:17: 12:26]`
|
||
|
found type `[closure@$DIR/issue-24036.rs:13:9: 13:18]`
|
||
|
note: no two closures, even if identical, have the same type
|
||
|
--> $DIR/issue-24036.rs:13:9
|
||
|
|
|
||
|
13 | x = |c| c + 1;
|
||
|
| ^^^^^^^^^
|
||
|
help: consider boxing your closure and/or using it as a trait object
|
||
|
--> $DIR/issue-24036.rs:13:9
|
||
|
|
|
||
|
13 | x = |c| c + 1;
|
||
|
| ^^^^^^^^^
|
||
|
|
||
|
error[E0308]: match arms have incompatible types
|
||
|
--> $DIR/issue-24036.rs:23:13
|
||
|
|
|
||
|
23 | let x = match 1usize {
|
||
|
| _____________^
|
||
|
24 | | 1 => |c| c + 1,
|
||
|
25 | | 2 => |c| c - 1,
|
||
|
26 | | //~^ NOTE match arm with an incompatible type
|
||
|
27 | | _ => |c| c - 1
|
||
|
28 | | };
|
||
|
| |_____^ expected closure, found a different closure
|
||
|
|
|
||
|
= note: expected type `[closure@$DIR/issue-24036.rs:24:14: 24:23]`
|
||
|
found type `[closure@$DIR/issue-24036.rs:25:14: 25:23]`
|
||
|
note: no two closures, even if identical, have the same type
|
||
|
--> $DIR/issue-24036.rs:23:13
|
||
|
|
|
||
|
23 | let x = match 1usize {
|
||
|
| _____________^
|
||
|
24 | | 1 => |c| c + 1,
|
||
|
25 | | 2 => |c| c - 1,
|
||
|
26 | | //~^ NOTE match arm with an incompatible type
|
||
|
27 | | _ => |c| c - 1
|
||
|
28 | | };
|
||
|
| |_____^
|
||
|
help: consider boxing your closure and/or using it as a trait object
|
||
|
--> $DIR/issue-24036.rs:23:13
|
||
|
|
|
||
|
23 | let x = match 1usize {
|
||
|
| _____________^
|
||
|
24 | | 1 => |c| c + 1,
|
||
|
25 | | 2 => |c| c - 1,
|
||
|
26 | | //~^ NOTE match arm with an incompatible type
|
||
|
27 | | _ => |c| c - 1
|
||
|
28 | | };
|
||
|
| |_____^
|
||
|
note: match arm with an incompatible type
|
||
|
--> $DIR/issue-24036.rs:25:14
|
||
|
|
|
||
|
25 | 2 => |c| c - 1,
|
||
|
| ^^^^^^^^^
|
||
|
|
||
|
error: aborting due to 2 previous errors
|
||
|
|