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