]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/issue-52443.rs
Auto merge of #68423 - Centril:rollup-bdjykrv, r=Centril
[rust.git] / src / test / compile-fail / issue-52443.rs
1 fn main() {
2     [(); & { loop { continue } } ]; //~ ERROR mismatched types
3     //~^ ERROR `loop` is not allowed in a `const`
4     [(); loop { break }]; //~ ERROR mismatched types
5     //~^ ERROR `loop` is not allowed in a `const`
6     [(); {while true {break}; 0}];
7     //~^ ERROR `while` is not allowed in a `const`
8     //~| WARN denote infinite loops with
9     [(); { for _ in 0usize.. {}; 0}];
10     //~^ ERROR calls in constants are limited to constant functions
11     //~| ERROR calls in constants are limited to constant functions
12     //~| ERROR `for` is not allowed in a `const`
13     //~| ERROR references in constants may only refer to immutable values
14     //~| ERROR evaluation of constant value failed
15     //~| ERROR constant contains unimplemented expression type
16 }