]> git.lizzy.rs Git - rust.git/blob - tests/ui/match/match-incompat-type-semi.stderr
Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
[rust.git] / tests / ui / match / match-incompat-type-semi.stderr
1 error[E0308]: `match` arms have incompatible types
2   --> $DIR/match-incompat-type-semi.rs:11:13
3    |
4 LL |       let _ = match Some(42) {
5    |  _____________-
6 LL | |         Some(x) => {
7 LL | |             x
8    | |             - this is found to be of type `{integer}`
9 LL | |         },
10 LL | |         None => {
11 LL | |             0;
12    | |             ^-
13    | |             ||
14    | |             |help: consider removing this semicolon
15    | |             expected integer, found `()`
16 ...  |
17 LL | |         },
18 LL | |     };
19    | |_____- `match` arms have incompatible types
20
21 error[E0308]: `if` and `else` have incompatible types
22   --> $DIR/match-incompat-type-semi.rs:20:9
23    |
24 LL |       let _ = if let Some(x) = Some(42) {
25    |  _____________-
26 LL | |         x
27    | |         - expected because of this
28 LL | |     } else {
29 LL | |         0;
30    | |         ^-
31    | |         ||
32    | |         |help: consider removing this semicolon
33    | |         expected integer, found `()`
34 LL | |
35 LL | |
36 LL | |     };
37    | |_____- `if` and `else` have incompatible types
38
39 error[E0308]: `match` arms have incompatible types
40   --> $DIR/match-incompat-type-semi.rs:30:13
41    |
42 LL |       let _ = match Some(42) {
43    |  _____________-
44 LL | |         Some(x) => {
45 LL | |             x
46    | |             - this is found to be of type `{integer}`
47 LL | |         },
48 LL | |         None => {
49 LL | |             ();
50    | |             ^^^ expected integer, found `()`
51 LL | |
52 LL | |         },
53 LL | |     };
54    | |_____- `match` arms have incompatible types
55
56 error[E0308]: `match` arms have incompatible types
57   --> $DIR/match-incompat-type-semi.rs:39:17
58    |
59 LL |       let _ = match Some(42) {
60    |               -------------- `match` arms have incompatible types
61 LL |           Some(x) => {
62 LL |               x
63    |               - this is found to be of type `{integer}`
64 LL |           },
65 LL |           None => {
66    |  _________________^
67 LL | |         },
68    | |_________^ expected integer, found `()`
69
70 error[E0308]: `match` arms have incompatible types
71   --> $DIR/match-incompat-type-semi.rs:50:17
72    |
73 LL |       let _ = match Some(42) {
74    |               -------------- `match` arms have incompatible types
75 LL |           Some(x) => "rust-lang.org"
76    |  ____________________-
77 LL | |             .chars()
78 LL | |             .skip(1)
79 LL | |             .chain(Some(x as u8 as char))
80 LL | |             .take(10)
81 LL | |             .any(char::is_alphanumeric),
82    | |_______________________________________- this is found to be of type `bool`
83 LL |           None => {}
84    |                   ^^ expected `bool`, found `()`
85
86 error: aborting due to 5 previous errors
87
88 For more information about this error, try `rustc --explain E0308`.