Tweak output of type mismatch between "then" and else if arms#57381
Tweak output of type mismatch between "then" and else if arms#57381bors merged 2 commits intorust-lang:masterfrom
else if arms#57381Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
@bors r+ |
|
📌 Commit 81f2cf0091fc3bc87db2093edc9b5bfca6797008 has been approved by |
|
⌛ Testing commit 81f2cf0091fc3bc87db2093edc9b5bfca6797008 with merge b366f65687a2ede5d206408861828dc32afbd17c... |
|
💔 Test failed - status-appveyor |
|
@bors retry |
|
rebased to get bors unstuck @bors r=nikomatsakis |
|
📌 Commit 54fe1c023a178d6f27c88de90cfdeda926584d19 has been approved by |
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
|
☔ The latest upstream changes (presumably #57580) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Fixed merge conflict @bors r=nikomatsakis |
|
📌 Commit 9567544 has been approved by |
Tweak output of type mismatch between "then" and `else` `if` arms
```
error[E0308]: if and else have incompatible types
--> $DIR/if-else-type-mismatch.rs:5:9
|
LL | let _ = if true {
| _____________-
LL | | 42i32
| | ----- expected because of this
LL | | } else {
LL | | 42u32
| | ^^^^^ expected i32, found u32
LL | | };
| |_____- if and else have incompatible types
|
= note: expected type `i32`
found type `u32`
error[E0308]: if and else have incompatible types
--> file.rs:2:38
|
LL | let _ = if false { 3u8; } else { 3u8 };
| ---- ^^^ expected (), found u8
| | |
| | help: consider removing this semicolon
| expected because of this
|
= note: expected type `()`
found type `u8`
error[E0308]: if and else have incompatible types
--> file.rs:3:37
|
LL | let _ = if false { 3u8 } else { 3u8; };
| --- ^^^-
| | | |
| | | help: consider removing this semicolon
| | expected u8, found ()
| expected because of this
|
= note: expected type `u8`
found type `()`
error[E0308]: if and else have incompatible types
--> file.rs:4:37
|
LL | let _ = if false { 3i8 } else { 3u8 };
| --- ^^^ expected i8, found u8
| |
| expected because of this
|
= note: expected type `i8`
found type `u8`
```
Fix #57348.
|
☀️ Test successful - checks-travis, status-appveyor |
Fix #57348.