about summary refs log tree commit diff
path: root/tests/ui/loop-match/invalid.stderr
blob: 9e9796a2ea7947040ccb4683517edff858544f53 (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
error[E0308]: mismatched types
  --> $DIR/invalid.rs:120:21
   |
LL |                     break 'blk;
   |                     ^^^^^^^^^^ expected `State`, found `()`
   |
help: give the `break` a value of the expected type
   |
LL |                     break 'blk /* value */;
   |                                +++++++++++

error[E0695]: unlabeled `break` inside of a labeled block
  --> $DIR/invalid.rs:154:25
   |
LL |                         break State::A;
   |                         ^^^^^^^^^^^^^^ `break` statements that would diverge to or through a labeled block need to bear a label

error: invalid update of the `#[loop_match]` state
  --> $DIR/invalid.rs:18:9
   |
LL |         fake = 'blk: {
   |         ^^^^
LL |
LL |             match state {
   |                   ----- the assignment must update this variable

error: invalid match on `#[loop_match]` state
  --> $DIR/invalid.rs:32:19
   |
LL |             match State::A {
   |                   ^^^^^^^^
   |
   = note: a local variable must be the scrutinee within a `#[loop_match]`

error: statements are not allowed in this position within a `#[loop_match]`
  --> $DIR/invalid.rs:44:9
   |
LL |         1;
   |         ^^

error: statements are not allowed in this position within a `#[loop_match]`
  --> $DIR/invalid.rs:59:13
   |
LL |             1;
   |             ^^

error: this expression must be a single `match` wrapped in a labeled block
  --> $DIR/invalid.rs:72:17
   |
LL |         state = State::B
   |                 ^^^^^^^^

error: this expression must be a single `match` wrapped in a labeled block
  --> $DIR/invalid.rs:82:13
   |
LL |             State::B
   |             ^^^^^^^^

error: this expression must be a single `match` wrapped in a labeled block
  --> $DIR/invalid.rs:92:17
   |
LL |           state = 'blk: {
   |  _________________^
LL | |
LL | |         }
   | |_________^

error: expected a single assignment expression
  --> $DIR/invalid.rs:101:9
   |
LL |         ()
   |         ^^

error: expected a single assignment expression
  --> $DIR/invalid.rs:107:10
   |
LL |       loop {
   |  __________^
LL | |
LL | |     }
   | |_____^

error: a `#[const_continue]` must break to a label with a value
  --> $DIR/invalid.rs:137:21
   |
LL |                     break 'blk;
   |                     ^^^^^^^^^^

error: a `#[const_continue]` must break to a label with a value
  --> $DIR/invalid.rs:154:25
   |
LL |                         break State::A;
   |                         ^^^^^^^^^^^^^^

error: match arms that are part of a `#[loop_match]` cannot have guards
  --> $DIR/invalid.rs:174:29
   |
LL |                 State::B if cond => break 'a,
   |                             ^^^^

error[E0004]: non-exhaustive patterns: `State::B` and `State::C` not covered
  --> $DIR/invalid.rs:187:19
   |
LL |             match state {
   |                   ^^^^^ patterns `State::B` and `State::C` not covered
   |
note: `State` defined here
  --> $DIR/invalid.rs:7:6
   |
LL | enum State {
   |      ^^^^^
LL |     A,
LL |     B,
   |     - not covered
LL |     C,
   |     - not covered
   = note: the matched value is of type `State`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
   |
LL ~                 State::A => State::B,
LL ~                 State::B | State::C => todo!(),
   |

error[E0579]: lower range bound must be less than upper
  --> $DIR/invalid.rs:204:17
   |
LL |                 4.0..3.0 => {
   |                 ^^^^^^^^

error: aborting due to 16 previous errors

Some errors have detailed explanations: E0004, E0308, E0579, E0695.
For more information about an error, try `rustc --explain E0004`.