]> git.lizzy.rs Git - rust.git/blob - src/test/ui/match/match-type-err-first-arm.stderr
Remove E0308 note when primary label has all info
[rust.git] / src / test / ui / match / match-type-err-first-arm.stderr
1 error[E0308]: mismatched types
2   --> $DIR/match-type-err-first-arm.rs:8:15
3    |
4 LL | fn test_func1(n: i32) -> i32 {
5    |                          --- expected `i32` because of return type
6 LL |     match n {
7 LL |         12 => 'b',
8    |               ^^^ expected i32, found char
9
10 error[E0308]: match arms have incompatible types
11   --> $DIR/match-type-err-first-arm.rs:18:14
12    |
13 LL |       let x = match n {
14    |  _____________-
15 LL | |         12 => 'b',
16    | |               --- this is found to be of type `char`
17 LL | |         _ => 42,
18    | |              ^^ expected char, found integer
19 LL | |
20 LL | |
21 LL | |     };
22    | |_____- `match` arms have incompatible types
23
24 error[E0308]: match arms have incompatible types
25   --> $DIR/match-type-err-first-arm.rs:34:14
26    |
27 LL |       let x = match n {
28    |  _____________-
29 LL | |         1 => 'b',
30 LL | |         2 => 'b',
31 LL | |         3 => 'b',
32 ...  |
33 LL | |         6 => 'b',
34    | |              --- this and all prior arms are found to be of type `char`
35 LL | |
36 LL | |         _ => 42,
37    | |              ^^ expected char, found integer
38 LL | |
39 LL | |
40 LL | |     };
41    | |_____- `match` arms have incompatible types
42
43 error[E0308]: match arms have incompatible types
44   --> $DIR/match-type-err-first-arm.rs:46:17
45    |
46 LL | /     match Some(0u32) {
47 LL | |         Some(x) => {
48 LL | |             x
49    | |             - this is found to be of type `u32`
50 LL | |         },
51 LL | |         None => {}
52    | |                 ^^ expected u32, found ()
53 LL | |
54 LL | |
55 LL | |     };
56    | |_____- `match` arms have incompatible types
57
58 error: aborting due to 4 previous errors
59
60 For more information about this error, try `rustc --explain E0308`.