Skip to content

Conversation

@A4-Tacks
Copy link
Member

Fix not applicable in statement when exist else block

Example

fn main() {
    some_statements();
    if$0 let Ok(x) = Err(92) {
        foo(x);
    } else {
        return;
    }
    some_statements();
}

Before this PR

Assist not applicable

After this PR

fn main() {
    some_statements();
    let Ok(x) = Err(92) else {
        return;
    };
    foo(x);
    some_statements();
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 31, 2025
@A4-Tacks A4-Tacks mentioned this pull request Nov 19, 2025
41 tasks
Fix not applicable in statement when exist else block

Example
---
```rust
fn main() {
    some_statements();
    if$0 let Ok(x) = Err(92) {
        foo(x);
    } else {
        return;
    }
    some_statements();
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn main() {
    some_statements();
    let Ok(x) = Err(92) else {
        return;
    };
    foo(x);
    some_statements();
}
```
@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Jan 13, 2026
Merged via the queue into rust-lang:master with commit 7a248da Jan 13, 2026
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 13, 2026
@A4-Tacks A4-Tacks deleted the to-guarded-in-stmt branch January 14, 2026 10:29
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