mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
858 B
23 lines
858 B
$ cargo run
|
|
Compiling enums v0.1.0 (file:///projects/enums)
|
|
error[E0004]: non-exhaustive patterns: `None` not covered
|
|
--> src/main.rs:3:15
|
|
|
|
|
3 | match x {
|
|
| ^ pattern `None` not covered
|
|
|
|
|
note: `Option<i32>` defined here
|
|
--> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:574:1
|
|
::: /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:578:5
|
|
|
|
|
= note: not covered
|
|
= note: the matched value is of type `Option<i32>`
|
|
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
|
|
|
|
4 ~ Some(i) => Some(i + 1),
|
|
5 ~ None => todo!(),
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0004`.
|
|
error: could not compile `enums` (bin "enums") due to 1 previous error
|