summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/brace-in-let-chain.rs
blob: 1f34c73a2c3bde036617bea36a0ad62eec634506 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// issue #117766

#![feature(let_chains)]
fn main() {
    if let () = ()
        && let () = () { //~ERROR: found a `{` in the middle of a let-chain
        && let () = ()
    {
    }
}

fn quux() {
    while let () = ()
        && let () = () { //~ERROR: found a `{` in the middle of a let-chain
        && let () = ()
    {
    }
}

fn foobar() {
    while false {}
    {
        && let () = ()
}

fn fubar() {
    while false {
        {
            && let () = ()
    }
}

fn qux() {
    let foo = false;
    match foo {
        _ if foo => {
            && let () = ()
        _ => {}
    }
}

fn foo() {
    {
    && let () = ()
}

fn bar() {
    if false {}
    {
        && let () = ()
}

fn baz() {
    if false {
        {
            && let () = ()
    }
} //~ERROR: this file contains an unclosed delimiter