2018-07-01 14:57:23 -05:00
|
|
|
fn main() {
|
2021-06-10 18:20:00 -05:00
|
|
|
//~^ NOTE: not the enclosing function body
|
|
|
|
//~| NOTE: not the enclosing function body
|
|
|
|
//~| NOTE: not the enclosing function body
|
2019-11-06 14:29:30 -06:00
|
|
|
[(); return match 0 { n => n }];
|
2021-06-10 18:20:00 -05:00
|
|
|
//~^ ERROR: return statement outside of function body [E0572]
|
|
|
|
//~| NOTE: the return is part of this body...
|
2018-07-01 14:57:23 -05:00
|
|
|
|
2019-11-06 14:29:30 -06:00
|
|
|
[(); return match 0 { 0 => 0 }];
|
2021-06-10 18:20:00 -05:00
|
|
|
//~^ ERROR: return statement outside of function body [E0572]
|
|
|
|
//~| NOTE: the return is part of this body...
|
2018-07-01 14:57:23 -05:00
|
|
|
|
2019-11-06 14:29:30 -06:00
|
|
|
[(); return match () { 'a' => 0, _ => 0 }];
|
2021-06-10 18:20:00 -05:00
|
|
|
//~^ ERROR: return statement outside of function body [E0572]
|
|
|
|
//~| NOTE: the return is part of this body...
|
|
|
|
//~| ERROR: mismatched types [E0308]
|
|
|
|
//~| NOTE: expected `()`, found `char`
|
|
|
|
//~| NOTE: this expression has type `()`
|
2018-07-01 14:57:23 -05:00
|
|
|
}
|