File: cross-const-control-flow-125846.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (78 lines) | stat: -rw-r--r-- 2,648 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
error[E0767]: use of unreachable label `'a`
  --> $DIR/cross-const-control-flow-125846.rs:9:25
   |
LL |     'a: { const { break 'a } }
   |     --                  ^^ unreachable label `'a`
   |     |
   |     unreachable label defined here
   |
   = note: labels are unreachable through functions, closures, async blocks and modules

error[E0767]: use of unreachable label `'a`
  --> $DIR/cross-const-control-flow-125846.rs:22:28
   |
LL |     'a: { const { continue 'a } }
   |     --                     ^^ unreachable label `'a`
   |     |
   |     unreachable label defined here
   |
   = note: labels are unreachable through functions, closures, async blocks and modules

error[E0435]: attempt to use a non-constant value in a constant
  --> $DIR/cross-const-control-flow-125846.rs:41:14
   |
LL |     const { &x };
   |              ^ non-constant value
   |
help: consider using `const` instead of `let`
   |
LL |     const x: /* Type */ = 1;
   |     ~~~~~  ++++++++++++

error[E0728]: `await` is only allowed inside `async` functions and blocks
  --> $DIR/cross-const-control-flow-125846.rs:35:22
   |
LL |     const { async {}.await }
   |           -----------^^^^^--
   |           |          |
   |           |          only allowed inside `async` functions and blocks
   |           this is not `async`

error[E0268]: `break` outside of a loop or labeled block
  --> $DIR/cross-const-control-flow-125846.rs:9:19
   |
LL |     'a: { const { break 'a } }
   |                   ^^^^^^^^ cannot `break` outside of a loop or labeled block

error[E0268]: `break` outside of a loop or labeled block
  --> $DIR/cross-const-control-flow-125846.rs:16:17
   |
LL |         const { break }
   |                 ^^^^^ cannot `break` outside of a loop or labeled block

error[E0268]: `continue` outside of a loop
  --> $DIR/cross-const-control-flow-125846.rs:22:19
   |
LL |     'a: { const { continue 'a } }
   |                   ^^^^^^^^^^^ cannot `continue` outside of a loop

error[E0268]: `continue` outside of a loop
  --> $DIR/cross-const-control-flow-125846.rs:29:17
   |
LL |         const { continue }
   |                 ^^^^^^^^ cannot `continue` outside of a loop

error[E0572]: return statement outside of function body
  --> $DIR/cross-const-control-flow-125846.rs:4:13
   |
LL | / fn foo() {
LL | |     const { return }
   | |           --^^^^^^-- the return is part of this body...
LL | |
LL | | }
   | |_- ...not the enclosing function body

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0268, E0435, E0572, E0728, E0767.
For more information about an error, try `rustc --explain E0268`.