rust/tests/ui/loops/loop-no-implicit-break.rs

32 lines
410 B
Rust
Raw Normal View History

2021-04-24 11:08:22 -05:00
fn main() {
2021-04-24 12:00:24 -05:00
let a: i8 = loop {
1 //~ ERROR mismatched types
2021-04-24 11:08:22 -05:00
};
2021-04-24 12:00:24 -05:00
let b: i8 = loop {
break 1;
};
}
fn foo() -> i8 {
let a: i8 = loop {
1 //~ ERROR mismatched types
};
let b: i8 = loop {
break 1;
};
loop {
1 //~ ERROR mismatched types
}
loop {
return 1;
}
2021-04-24 15:20:08 -05:00
loop {
1 //~ ERROR mismatched types
}
2021-04-24 11:08:22 -05:00
}