|
1 | 1 | error[E0572]: return statement outside of function body
|
2 |
| - --> $DIR/return-match-array-const.rs:2:10 |
| 2 | + --> $DIR/return-match-array-const.rs:5:10 |
3 | 3 | |
|
4 |
| -LL | [(); return match 0 { n => n }]; |
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 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 |
6 | 14 |
|
7 | 15 | error[E0572]: return statement outside of function body
|
8 |
| - --> $DIR/return-match-array-const.rs:5:10 |
| 16 | + --> $DIR/return-match-array-const.rs:9:10 |
9 | 17 | |
|
10 |
| -LL | [(); return match 0 { 0 => 0 }]; |
11 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 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 |
12 | 29 |
|
13 | 30 | error[E0572]: return statement outside of function body
|
14 |
| - --> $DIR/return-match-array-const.rs:8:10 |
| 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 |
15 | 47 | |
|
16 | 48 | LL | [(); return match () { 'a' => 0, _ => 0 }];
|
17 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 49 | + | -- ^^^ expected `()`, found `char` |
| 50 | + | | |
| 51 | + | this expression has type `()` |
18 | 52 |
|
19 |
| -error: aborting due to 3 previous errors |
| 53 | +error: aborting due to 4 previous errors |
20 | 54 |
|
21 |
| -For more information about this error, try `rustc --explain E0572`. |
| 55 | +Some errors have detailed explanations: E0308, E0572. |
| 56 | +For more information about an error, try `rustc --explain E0308`. |
0 commit comments