summaryrefslogtreecommitdiffstats
path: root/tests/ui/match/match-incompat-type-semi.stderr
blob: 008b1c1e93d6d8641ff095ca498eaaea7651ee61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
error[E0308]: `match` arms have incompatible types
  --> $DIR/match-incompat-type-semi.rs:11:13
   |
LL |       let _ = match Some(42) {
   |  _____________-
LL | |         Some(x) => {
LL | |             x
   | |             - this is found to be of type `{integer}`
LL | |         },
LL | |         None => {
LL | |             0;
   | |             ^-
   | |             ||
   | |             |help: consider removing this semicolon
   | |             expected integer, found `()`
...  |
LL | |         },
LL | |     };
   | |_____- `match` arms have incompatible types

error[E0308]: `if` and `else` have incompatible types
  --> $DIR/match-incompat-type-semi.rs:20:9
   |
LL |       let _ = if let Some(x) = Some(42) {
   |  _____________-
LL | |         x
   | |         - expected because of this
LL | |     } else {
LL | |         0;
   | |         ^-
   | |         ||
   | |         |help: consider removing this semicolon
   | |         expected integer, found `()`
LL | |
LL | |
LL | |     };
   | |_____- `if` and `else` have incompatible types

error[E0308]: `match` arms have incompatible types
  --> $DIR/match-incompat-type-semi.rs:30:13
   |
LL |       let _ = match Some(42) {
   |  _____________-
LL | |         Some(x) => {
LL | |             x
   | |             - this is found to be of type `{integer}`
LL | |         },
LL | |         None => {
LL | |             ();
   | |             ^^^ expected integer, found `()`
LL | |
LL | |         },
LL | |     };
   | |_____- `match` arms have incompatible types

error[E0308]: `match` arms have incompatible types
  --> $DIR/match-incompat-type-semi.rs:39:17
   |
LL |       let _ = match Some(42) {
   |               -------------- `match` arms have incompatible types
LL |           Some(x) => {
LL |               x
   |               - this is found to be of type `{integer}`
LL |           },
LL |           None => {
   |  _________________^
LL | |         },
   | |_________^ expected integer, found `()`

error[E0308]: `match` arms have incompatible types
  --> $DIR/match-incompat-type-semi.rs:50:17
   |
LL |       let _ = match Some(42) {
   |               -------------- `match` arms have incompatible types
LL |           Some(x) => "rust-lang.org"
   |  ____________________-
LL | |             .chars()
LL | |             .skip(1)
LL | |             .chain(Some(x as u8 as char))
LL | |             .take(10)
LL | |             .any(char::is_alphanumeric),
   | |_______________________________________- this is found to be of type `bool`
LL |           None => {}
   |                   ^^ expected `bool`, found `()`

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.