rust/tests/ui/match/postfix-match/match-after-as.stderr
2024-04-02 19:06:28 -04:00

29 lines
741 B
Plaintext

error: cast cannot be followed by a postfix match
--> $DIR/match-after-as.rs:4:5
|
LL | 1 as i32.match {};
| ^^^^^^^^
|
help: try surrounding the expression in parentheses
|
LL | (1 as i32).match {};
| + +
error[E0004]: non-exhaustive patterns: type `i32` is non-empty
--> $DIR/match-after-as.rs:4:5
|
LL | 1 as i32.match {};
| ^^^^^^^^
|
= note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ 1 as i32.match {
LL + _ => todo!(),
LL ~ };
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0004`.