summary refs log tree commit diff
path: root/src/test/compile-fail/issue-52443.rs
blob: ee37aaa5e13b943c7b715e3d42f24c47e210454a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() {
    [(); & { loop { continue } } ]; //~ ERROR mismatched types
    //~^ ERROR `loop` is not allowed in a `const`
    [(); loop { break }]; //~ ERROR mismatched types
    //~^ ERROR `loop` is not allowed in a `const`
    [(); {while true {break}; 0}];
    //~^ ERROR `while` is not allowed in a `const`
    //~| WARN denote infinite loops with
    [(); { for _ in 0usize.. {}; 0}];
    //~^ ERROR calls in constants are limited to constant functions
    //~| ERROR `for` is not allowed in a `const`
    //~| ERROR references in constants may only refer to immutable values
    //~| ERROR evaluation of constant value failed
    //~| ERROR constant contains unimplemented expression type
}