Err(_) => println!("err")
}
+ // this is a current false positive, see #1996
+ match x {
+ Ok(3) => println!("ok"),
+ Ok(x) if x*x == 64 => println!("ok 64"),
+ Ok(_) => println!("ok"),
+ Err(_) => println!("err")
+ }
+
match (x, Some(1i32)) {
(Ok(x), Some(_)) => println!("ok {}", x),
(Ok(_), Some(x)) => println!("ok {}", x),
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: this `match` has identical arm bodies
- --> $DIR/matches.rs:290:29
+ --> $DIR/matches.rs:292:18
|
-290 | (Ok(_), Some(x)) => println!("ok {}", x),
+292 | Ok(_) => println!("ok"),
+ | ^^^^^^^^^^^^^^
+ |
+note: same as this
+ --> $DIR/matches.rs:290:18
+ |
+290 | Ok(3) => println!("ok"),
+ | ^^^^^^^^^^^^^^
+note: consider refactoring into `Ok(3) | Ok(_)`
+ --> $DIR/matches.rs:290:18
+ |
+290 | Ok(3) => println!("ok"),
+ | ^^^^^^^^^^^^^^
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+error: this `match` has identical arm bodies
+ --> $DIR/matches.rs:298:29
+ |
+298 | (Ok(_), Some(x)) => println!("ok {}", x),
| ^^^^^^^^^^^^^^^^^^^^
|
note: same as this
- --> $DIR/matches.rs:289:29
+ --> $DIR/matches.rs:297:29
|
-289 | (Ok(x), Some(_)) => println!("ok {}", x),
+297 | (Ok(x), Some(_)) => println!("ok {}", x),
| ^^^^^^^^^^^^^^^^^^^^
note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
- --> $DIR/matches.rs:289:29
+ --> $DIR/matches.rs:297:29
|
-289 | (Ok(x), Some(_)) => println!("ok {}", x),
+297 | (Ok(x), Some(_)) => println!("ok {}", x),
| ^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)