Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Jan 6, 2026

Example

fn main() {
    let cond = true;
    match 92 {
        3 => true,
        x if cond => if x $0> 10 {
            false
        } else if x > 5 {
            true
        } else if x > 4 || x < -2 {
            false
        } else {
            true
        },
    }
}

Before this PR

fn main() {
    let cond = true;
    match 92 {
        3 => true,
        x if x > 10 => false,
        x if x > 5 => true,
        x if x > 4 || x < -2 => false,
        x => true,
    }
}

After this PR

fn main() {
    let cond = true;
    match 92 {
        3 => true,
        x if cond && x > 10 => false,
        x if cond && x > 5 => true,
        x if cond && (x > 4 || x < -2) => false,
        x if cond => true,
    }
}

Example
---
```rust
fn main() {
    let cond = true;
    match 92 {
        3 => true,
        x if cond => if x $0> 10 {
            false
        } else if x > 5 {
            true
        } else if x > 4 || x < -2 {
            false
        } else {
            true
        },
    }
}
```

**Before this PR**

```rust
fn main() {
    let cond = true;
    match 92 {
        3 => true,
        x if x > 10 => false,
        x if x > 5 => true,
        x if x > 4 || x < -2 => false,
        x => true,
    }
}
```

**After this PR**

```rust
fn main() {
    let cond = true;
    match 92 {
        3 => true,
        x if cond && x > 10 => false,
        x if cond && x > 5 => true,
        x if cond && (x > 4 || x < -2) => false,
        x if cond => true,
    }
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 6, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants