]> git.lizzy.rs Git - rust.git/blob - src/test/ui/return/return-match-array-const.rs
Rollup merge of #101388 - compiler-errors:issue-101376, r=fee1-dead
[rust.git] / src / test / ui / return / return-match-array-const.rs
1 fn main() {
2 //~^ NOTE: not the enclosing function body
3 //~| NOTE: not the enclosing function body
4 //~| NOTE: not the enclosing function body
5     [(); return match 0 { n => n }];
6     //~^ ERROR: return statement outside of function body [E0572]
7     //~| NOTE: the return is part of this body...
8
9     [(); return match 0 { 0 => 0 }];
10     //~^ ERROR: return statement outside of function body [E0572]
11     //~| NOTE: the return is part of this body...
12
13     [(); return match () { 'a' => 0, _ => 0 }];
14     //~^ ERROR: return statement outside of function body [E0572]
15     //~| NOTE: the return is part of this body...
16     //~| ERROR: mismatched types [E0308]
17     //~| NOTE: expected `()`, found `char`
18     //~| NOTE: this expression has type `()`
19 }