mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 23:38:41 +08:00
20 lines
533 B
Plaintext
20 lines
533 B
Plaintext
$ cargo run
|
|
Compiling patterns v0.1.0 (file:///projects/patterns)
|
|
warning: irrefutable `if let` pattern
|
|
--> src/main.rs:2:5
|
|
|
|
|
2 | / if let x = 5 {
|
|
3 | | println!("{}", x);
|
|
4 | | };
|
|
| |_____^
|
|
|
|
|
= note: `#[warn(irrefutable_let_patterns)]` on by default
|
|
= note: this pattern will always match, so the `if let` is useless
|
|
= help: consider replacing the `if let` with a `let`
|
|
|
|
warning: 1 warning emitted
|
|
|
|
Finished dev [unoptimized + debuginfo] target(s) in 0.39s
|
|
Running `target/debug/patterns`
|
|
5
|