For half-open ranges, specifies that the upper bound cannot be the minimum. Also specify that this only applies to range patterns and not also expressions.
133 lines
3.7 KiB
Text
133 lines
3.7 KiB
Text
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 bound for range pattern must be less than upper bound
|
|
--> $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`.
|