rust/tests/ui/issues/issue-51714.rs
2023-01-11 09:32:08 +00:00

22 lines
786 B
Rust

fn main() {
//~^ NOTE: not the enclosing function body
//~| NOTE: not the enclosing function body
//~| NOTE: not the enclosing function body
//~| NOTE: not the enclosing function body
|_: [_; return || {}] | {};
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
[(); return || {}];
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
[(); return |ice| {}];
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
[(); return while let Some(n) = Some(0) {}];
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
}