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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
410 B
Rust
Raw Normal View History

2021-04-24 16:08:22 +00:00
fn main() {
2021-04-24 17:00:24 +00:00
let a: i8 = loop {
1 //~ ERROR mismatched types
2021-04-24 16:08:22 +00:00
};
2021-04-24 17:00:24 +00: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 20:20:08 +00:00
loop {
1 //~ ERROR mismatched types
}
2021-04-24 16:08:22 +00:00
}