about summary refs log tree commit diff
path: root/tests/ui/parser/or-in-let-chain.rs
blob: 4c4372bb00f0fd5ac2ccc4c57becff02206ff175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ revisions: edition2021 edition2024
//@ [edition2021] edition: 2021
//@ [edition2024] edition: 2024

fn main() {
    if let true = true || false {}
    //~^ ERROR `||` operators are not supported in let chain conditions
    // With parentheses
    if (let true = true) || false {}
    //~^ ERROR expected expression, found `let` statement
    // Multiple || operators
    if let true = true || false || true {}
    //~^ ERROR `||` operators are not supported in let chain conditions
    // Mixed operators (should still show error for ||)
    if let true = true && false || true {}
    //~^ ERROR `||` operators are not supported in let chain conditions
}