Skip to content

fix: Fix unwrap_branch in match_arm#22247

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:unwrap-branch-in-match-arm
May 2, 2026
Merged

fix: Fix unwrap_branch in match_arm#22247
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:unwrap-branch-in-match-arm

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

@A4-Tacks A4-Tacks commented May 2, 2026

Example

fn main() {
    match 1 {
        1 => if true {
            foo();
        } else {$0
            bar();
        }
        _ => (),
    }
}

Before this PR

fn main() {
    match 1 {
        1 => if true {
            foo();
        }
        bar();
        _ => (),
    }
}

After this PR

fn main() {
    match 1 {
        1 => {
            bar();
        }
        _ => (),
    }
}

Example
---
```rust
fn main() {
    match 1 {
        1 => if true {
            foo();
        } else {$0
            bar();
        }
        _ => (),
    }
}
```

**Before this PR**

```rust
fn main() {
    match 1 {
        1 => if true {
            foo();
        }
        bar();
        _ => (),
    }
}
```

**After this PR**

```rust
fn main() {
    match 1 {
        1 => {
            bar();
        }
        _ => (),
    }
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 2, 2026
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue May 2, 2026
Merged via the queue into rust-lang:master with commit ca08b0d May 2, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 2, 2026
@A4-Tacks A4-Tacks deleted the unwrap-branch-in-match-arm branch May 3, 2026 10:41
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