rust/tests/ui/issues/issue-51714.rs

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

22 lines
800 B
Rust
Raw Normal View History

fn main() {
2022-11-21 12:40:27 +00:00
//~^ 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...
2018-07-01 16:40:36 +00:00
[(); return while let Some(n) = Some(0) {}];
//~^ ERROR: return statement outside of function body [E0572]
//~| NOTE: the return is part of this body...
}