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
786 B
Rust
Raw Normal View History

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
2018-07-01 16:40:36 +00:00
|_: [_; 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...
}