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