gccrs: Handle `async` functions in traits
[official-gcc.git] / gcc / testsuite / rust / compile / break_with_value_inside_loop.rs
blob84491f62c2b4782415e84060df6054a4a076c470
1 // https://doc.rust-lang.org/error_codes/E0571.html
2 #![allow(unused)]
3 fn main() {
4     let mut i = 1;
5     fn satisfied(n: usize) -> bool {
6         n % 23 == 0
7     }
8     let result = while true {
9         if satisfied(i) {
10             break 2 * i;   // { dg-error "can only .break. with a value inside a .loop. block" }
11         }
12         i += 1;
13     };