Fix a bug with return in anonymous consts
This commit is contained in:
parent
b58b721921
commit
c6bbee802a
3 changed files with 17 additions and 8 deletions
|
|
@ -17,3 +17,8 @@ fn foo() {
|
|||
[(); return || {}];
|
||||
//~^ ERROR return statement outside of function body
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
[(); return |ice| {}];
|
||||
//~^ ERROR return statement outside of function body
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,12 @@ error[E0572]: return statement outside of function body
|
|||
LL | [(); return || {}];
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error[E0572]: return statement outside of function body
|
||||
--> $DIR/issue-51714.rs:22:10
|
||||
|
|
||||
LL | [(); return |ice| {}];
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0572`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue