Skip to content

fix: flip coerce_never type_mismatch tys#22451

Merged
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
A4-Tacks:type-mismatch-flip
May 25, 2026
Merged

fix: flip coerce_never type_mismatch tys#22451
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
A4-Tacks:type-mismatch-flip

Conversation

@A4-Tacks

Copy link
Copy Markdown
Member

Example

Before this PR

fn f() {
    if 1 {}
     //^ error: expected i32, found bool
    match () { _ if 1 => (), _ => () }
                  //^ error: expected i32, found bool
}

After this PR

fn f() {
    if 1 {}
     //^ error: expected bool, found i32
    match () { _ if 1 => (), _ => () }
                  //^ error: expected bool, found i32
}

Example
---
**Before this PR**

```rust
fn f() {
    if 1 {}
     //^ error: expected i32, found bool
    match () { _ if 1 => (), _ => () }
                  //^ error: expected i32, found bool
}
```

**After this PR**

```rust
fn f() {
    if 1 {}
     //^ error: expected bool, found i32
    match () { _ if 1 => (), _ => () }
                  //^ error: expected bool, found i32
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2026
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue May 25, 2026
Merged via the queue into rust-lang:master with commit 1fc0b38 May 25, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2026
@A4-Tacks A4-Tacks deleted the type-mismatch-flip branch May 25, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants