aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-3969.rs
blob: 9608589c3e2760992c85cada1f2d2ed5356e667c (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
#[lang = "sized"]
pub trait Sized {
    // Empty.
}

#[lang = "fn_once"]
pub trait FnOnce<Args> {
    #[lang = "fn_once_output"]
    type Output;

    extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
}

fn main() {
    [(); {
        while true {
            // { dg-error ".constexpr. loop iteration count exceeds limit" "" { target *-*-* } .-1 }
            break 9;
            // { dg-error "can only .break. with a value inside a .loop. block .E0571." "" { target *-*-* } .-1 }
        }
        51
    }];

    while true {
        break (|| {
            // { dg-error "can only .break. with a value inside a .loop. block .E0571." "" { target *-*-* } .-1 }
            let while_true = 9;
        });
    }
}