Debian Codegraph @

gcc/testsuite/rust/compile/break_with_value_inside_loop.rs

raw
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 };
14 }