修复19-10代码及其编译返还信息。

pull/872/head
须语 7 days ago
parent a50eb042c8
commit 7b0fa6a4bd

@ -1,13 +1,13 @@
$ cargo run
Compiling patterns v0.1.0 (file:///projects/patterns)
warning: irrefutable `let...else` pattern
--> src/main.rs:2:5
warning: irrefutable `if let` pattern
--> src/main.rs:2:8
|
2 | let x = 5 else {
| ^^^^^^^^^
2 | if let x = 5 {
| ^^^^^^^^^
|
= note: this pattern will always match, so the `else` clause is useless
= help: consider removing the `else` clause
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
= note: `#[warn(irrefutable_let_patterns)]` on by default
warning: `patterns` (bin "patterns") generated 1 warning

@ -1,7 +1,7 @@
fn main() {
// ANCHOR: here
if let x = 5 else {
return;
if let x = 5 {
println!("{x}");
};
// ANCHOR_END: here
}

Loading…
Cancel
Save