Skip to content

minor: fix panic unrelated expr for convert_match_to_let_else#22839

Open
A4-Tacks wants to merge 1 commit into
rust-lang:masterfrom
A4-Tacks:panic-match-to-letelse
Open

minor: fix panic unrelated expr for convert_match_to_let_else#22839
A4-Tacks wants to merge 1 commit into
rust-lang:masterfrom
A4-Tacks:panic-match-to-letelse

Conversation

@A4-Tacks

Copy link
Copy Markdown
Member

Example

fn foo(opt: Option<()>) {
    let n = 2;
    let val$0 = match opt {
        Some(it) => n,
        None => return,
    };
}

Before this PR

After apply: panic: TextRange -offset overflowed

After this PR

Assist not applicable

Example
---
```rust
fn foo(opt: Option<()>) {
    let n = 2;
    let val$0 = match opt {
        Some(it) => n,
        None => return,
    };
}
```

**Before this PR**

After apply: panic: TextRange -offset overflowed

**After this PR**

Assist not applicable
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

2 participants