]> git.lizzy.rs Git - rust.git/blob - tests/ui/return/return-match-array-const.stderr
Auto merge of #106742 - compiler-errors:new-solver-make-it-not-ice, r=lcnr
[rust.git] / tests / ui / return / return-match-array-const.stderr
1 error[E0572]: return statement outside of function body
2   --> $DIR/return-match-array-const.rs:5:10
3    |
4 LL | / fn main() {
5 LL | |
6 LL | |
7 LL | |
8 LL | |     [(); return match 0 { n => n }];
9    | |          ^^^^^^^^^^^^^^^^^^^^^^^^^ the return is part of this body...
10 ...  |
11 LL | |
12 LL | | }
13    | |_- ...not the enclosing function body
14
15 error[E0572]: return statement outside of function body
16   --> $DIR/return-match-array-const.rs:9:10
17    |
18 LL | / fn main() {
19 LL | |
20 LL | |
21 LL | |
22 ...  |
23 LL | |     [(); return match 0 { 0 => 0 }];
24    | |          ^^^^^^^^^^^^^^^^^^^^^^^^^ the return is part of this body...
25 ...  |
26 LL | |
27 LL | | }
28    | |_- ...not the enclosing function body
29
30 error[E0572]: return statement outside of function body
31   --> $DIR/return-match-array-const.rs:13:10
32    |
33 LL | / fn main() {
34 LL | |
35 LL | |
36 LL | |
37 ...  |
38 LL | |     [(); return match () { 'a' => 0, _ => 0 }];
39    | |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the return is part of this body...
40 ...  |
41 LL | |
42 LL | | }
43    | |_- ...not the enclosing function body
44
45 error[E0308]: mismatched types
46   --> $DIR/return-match-array-const.rs:13:28
47    |
48 LL |     [(); return match () { 'a' => 0, _ => 0 }];
49    |                       --   ^^^ expected `()`, found `char`
50    |                       |
51    |                       this expression has type `()`
52
53 error: aborting due to 4 previous errors
54
55 Some errors have detailed explanations: E0308, E0572.
56 For more information about an error, try `rustc --explain E0308`.