Skip to content

Conversation

A4-Tacks
Copy link
Contributor

@A4-Tacks A4-Tacks commented Sep 12, 2025

Fixes #20620

Example

fn main() {
    let x = if true {
        ()
    } $0 else {};
}

Before this PR:

fn main() {
    let x = if true {
        ()
    } else if $1 {
        $0
    }; else {};
}

After this PR:

fn main() {
    let x = if true {
        ()
    } else if $1 {
        $0
    } else {};
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 12, 2025
Example
---
```rust
fn main() {
    let x = if true {
        ()
    } $0 else {};
}
```

**Before this PR**:

```rust
fn main() {
    let x = if true {
        ()
    } else if $1 {
        $0
    }; else {};
}
```

**After this PR**:

```rust
fn main() {
    let x = if true {
        ()
    } else if $1 {
        $0
    } else {};
}
```
@A4-Tacks A4-Tacks force-pushed the fix-before-else-incomplete-let branch from 9f0bb08 to d42c81e Compare September 12, 2025 12:57
@lnicola
Copy link
Member

lnicola commented Sep 13, 2025

changelog fixup #20620

@lnicola lnicola added this pull request to the merge queue Sep 13, 2025
Merged via the queue into rust-lang:master with commit 8192c63 Sep 13, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 13, 2025
@A4-Tacks A4-Tacks deleted the fix-before-else-incomplete-let branch September 13, 2025 15:30
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