|
| 1 | +error[E0767]: use of unreachable label `'a` |
| 2 | + --> $DIR/cross_const_control_flow.rs:9:25 |
| 3 | + | |
| 4 | +LL | 'a: { const { break 'a } } |
| 5 | + | -- ^^ unreachable label `'a` |
| 6 | + | | |
| 7 | + | unreachable label defined here |
| 8 | + | |
| 9 | + = note: labels are unreachable through functions, closures, async blocks and modules |
| 10 | + |
| 11 | +error[E0767]: use of unreachable label `'a` |
| 12 | + --> $DIR/cross_const_control_flow.rs:22:28 |
| 13 | + | |
| 14 | +LL | 'a: { const { continue 'a } } |
| 15 | + | -- ^^ unreachable label `'a` |
| 16 | + | | |
| 17 | + | unreachable label defined here |
| 18 | + | |
| 19 | + = note: labels are unreachable through functions, closures, async blocks and modules |
| 20 | + |
| 21 | +error[E0435]: attempt to use a non-constant value in a constant |
| 22 | + --> $DIR/cross_const_control_flow.rs:41:14 |
| 23 | + | |
| 24 | +LL | const { &x }; |
| 25 | + | ^ non-constant value |
| 26 | + | |
| 27 | +help: consider using `const` instead of `let` |
| 28 | + | |
| 29 | +LL | const x: /* Type */ = 1; |
| 30 | + | ~~~~~ ++++++++++++ |
| 31 | + |
| 32 | +error[E0728]: `await` is only allowed inside `async` functions and blocks |
| 33 | + --> $DIR/cross_const_control_flow.rs:35:22 |
| 34 | + | |
| 35 | +LL | const { async {}.await } |
| 36 | + | -----------^^^^^-- |
| 37 | + | | | |
| 38 | + | | only allowed inside `async` functions and blocks |
| 39 | + | this is not `async` |
| 40 | + |
| 41 | +error[E0268]: `break` outside of a loop or labeled block |
| 42 | + --> $DIR/cross_const_control_flow.rs:9:19 |
| 43 | + | |
| 44 | +LL | 'a: { const { break 'a } } |
| 45 | + | ^^^^^^^^ cannot `break` outside of a loop or labeled block |
| 46 | + |
| 47 | +error[E0268]: `break` outside of a loop or labeled block |
| 48 | + --> $DIR/cross_const_control_flow.rs:16:17 |
| 49 | + | |
| 50 | +LL | const { break } |
| 51 | + | ^^^^^ cannot `break` outside of a loop or labeled block |
| 52 | + |
| 53 | +error[E0268]: `continue` outside of a loop |
| 54 | + --> $DIR/cross_const_control_flow.rs:22:19 |
| 55 | + | |
| 56 | +LL | 'a: { const { continue 'a } } |
| 57 | + | ^^^^^^^^^^^ cannot `continue` outside of a loop |
| 58 | + |
| 59 | +error[E0268]: `continue` outside of a loop |
| 60 | + --> $DIR/cross_const_control_flow.rs:29:17 |
| 61 | + | |
| 62 | +LL | const { continue } |
| 63 | + | ^^^^^^^^ cannot `continue` outside of a loop |
| 64 | + |
| 65 | +error[E0572]: return statement outside of function body |
| 66 | + --> $DIR/cross_const_control_flow.rs:4:13 |
| 67 | + | |
| 68 | +LL | / fn foo() { |
| 69 | +LL | | const { return } |
| 70 | + | | --^^^^^^-- the return is part of this body... |
| 71 | +LL | | |
| 72 | +LL | | } |
| 73 | + | |_- ...not the enclosing function body |
| 74 | + |
| 75 | +error: aborting due to 9 previous errors |
| 76 | + |
| 77 | +Some errors have detailed explanations: E0268, E0435, E0572, E0728, E0767. |
| 78 | +For more information about an error, try `rustc --explain E0268`. |
0 commit comments