]> git.proxmox.com Git - rustc.git/blob - src/test/ui/expr/if/if-else-type-mismatch.stderr
Update unsuspicious file list
[rustc.git] / src / test / ui / expr / if / if-else-type-mismatch.stderr
1 error[E0308]: `if` and `else` have incompatible types
2 --> $DIR/if-else-type-mismatch.rs:5:9
3 |
4 LL | let _ = if true {
5 | _____________-
6 LL | | 1i32
7 | | ---- expected because of this
8 LL | | } else {
9 LL | | 2u32
10 | | ^^^^ expected `i32`, found `u32`
11 LL | | };
12 | |_____- `if` and `else` have incompatible types
13 |
14 help: change the type of the numeric literal from `u32` to `i32`
15 |
16 LL | 2i32
17 | ~~~
18
19 error[E0308]: `if` and `else` have incompatible types
20 --> $DIR/if-else-type-mismatch.rs:8:38
21 |
22 LL | let _ = if true { 42i32 } else { 42u32 };
23 | ----- ^^^^^ expected `i32`, found `u32`
24 | |
25 | expected because of this
26 |
27 help: change the type of the numeric literal from `u32` to `i32`
28 |
29 LL | let _ = if true { 42i32 } else { 42i32 };
30 | ~~~
31
32 error[E0308]: `if` and `else` have incompatible types
33 --> $DIR/if-else-type-mismatch.rs:13:9
34 |
35 LL | let _ = if true {
36 | _____________-
37 LL | | 3u32;
38 | | -----
39 | | | |
40 | | | help: consider removing this semicolon
41 | | expected because of this
42 LL | | } else {
43 LL | | 4u32
44 | | ^^^^ expected `()`, found `u32`
45 LL | | };
46 | |_____- `if` and `else` have incompatible types
47
48 error[E0308]: `if` and `else` have incompatible types
49 --> $DIR/if-else-type-mismatch.rs:19:9
50 |
51 LL | let _ = if true {
52 | _____________-
53 LL | | 5u32
54 | | ---- expected because of this
55 LL | | } else {
56 LL | | 6u32;
57 | | ^^^^-
58 | | | |
59 | | | help: consider removing this semicolon
60 | | expected `u32`, found `()`
61 LL | | };
62 | |_____- `if` and `else` have incompatible types
63
64 error[E0308]: `if` and `else` have incompatible types
65 --> $DIR/if-else-type-mismatch.rs:25:9
66 |
67 LL | let _ = if true {
68 | _____________-
69 LL | | 7i32;
70 | | ----- expected because of this
71 LL | | } else {
72 LL | | 8u32
73 | | ^^^^ expected `()`, found `u32`
74 LL | | };
75 | |_____- `if` and `else` have incompatible types
76
77 error[E0308]: `if` and `else` have incompatible types
78 --> $DIR/if-else-type-mismatch.rs:31:9
79 |
80 LL | let _ = if true {
81 | _____________-
82 LL | | 9i32
83 | | ---- expected because of this
84 LL | | } else {
85 LL | | 10u32;
86 | | ^^^^^^ expected `i32`, found `()`
87 LL | | };
88 | |_____- `if` and `else` have incompatible types
89
90 error[E0308]: `if` and `else` have incompatible types
91 --> $DIR/if-else-type-mismatch.rs:37:9
92 |
93 LL | let _ = if true {
94 | _____________________-
95 LL | |
96 LL | | } else {
97 | |_____- expected because of this
98 LL | 11u32
99 | ^^^^^ expected `()`, found `u32`
100
101 error[E0308]: `if` and `else` have incompatible types
102 --> $DIR/if-else-type-mismatch.rs:42:12
103 |
104 LL | let _ = if true {
105 | ------- `if` and `else` have incompatible types
106 LL | 12i32
107 | ----- expected because of this
108 LL | } else {
109 | ____________^
110 LL | |
111 LL | | };
112 | |_____^ expected `i32`, found `()`
113
114 error: aborting due to 8 previous errors
115
116 For more information about this error, try `rustc --explain E0308`.