2017-02-07 14:05:30 -06:00
|
|
|
error: you don't need to add `&` to all patterns
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:11:9
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match v {
|
|
|
|
LL | | &Some(v) => println!("{:?}", v),
|
|
|
|
LL | | &None => println!("none"),
|
|
|
|
LL | | }
|
2018-04-05 14:18:38 -05:00
|
|
|
| |_________^
|
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | match *v {
|
|
|
|
LL | Some(v) => println!("{:?}", v),
|
|
|
|
LL | None => println!("none"),
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to all patterns
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:22:5
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match tup {
|
|
|
|
LL | | &(v, 1) => println!("{}", v),
|
|
|
|
LL | | _ => println!("none"),
|
|
|
|
LL | | }
|
2018-04-05 14:18:38 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | match *tup {
|
|
|
|
LL | (v, 1) => println!("{}", v),
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to both the expression and the patterns
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:28:5
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match &w {
|
|
|
|
LL | | &Some(v) => println!("{:?}", v),
|
|
|
|
LL | | &None => println!("none"),
|
|
|
|
LL | | }
|
2018-04-05 14:18:38 -05:00
|
|
|
| |_____^
|
2018-02-04 06:41:54 -06:00
|
|
|
help: try
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | match w {
|
|
|
|
LL | Some(v) => println!("{:?}", v),
|
|
|
|
LL | None => println!("none"),
|
2018-04-05 14:18:38 -05:00
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to all patterns
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:39:5
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / if let &None = a {
|
|
|
|
LL | | println!("none");
|
|
|
|
LL | | }
|
2018-04-07 03:23:27 -05:00
|
|
|
| |_____^
|
2017-02-07 14:05:30 -06:00
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | if let None = *a {
|
2018-05-29 03:56:58 -05:00
|
|
|
| ^^^^ ^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: you don't need to add `&` to both the expression and the patterns
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:44:5
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / if let &None = &b {
|
|
|
|
LL | | println!("none");
|
|
|
|
LL | | }
|
2018-04-07 03:23:27 -05:00
|
|
|
| |_____^
|
2018-02-04 06:41:54 -06:00
|
|
|
help: try
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | if let None = b {
|
2018-05-29 03:56:58 -05:00
|
|
|
| ^^^^ ^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2018-10-30 15:36:52 -05:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:55:9
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Err(_) => panic!("err"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-10-30 15:36:52 -05:00
|
|
|
= note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2018-10-30 15:36:52 -05:00
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:54:18
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(_) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2018-04-07 03:23:27 -05:00
|
|
|
|
|
2018-10-30 15:36:52 -05:00
|
|
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:53:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:53:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 07:25:58 -05:00
|
|
|
|
2017-02-11 00:57:50 -06:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:61:9
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Err(_) => panic!(),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-11 00:57:50 -06:00
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:60:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(_) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:59:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:59:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 07:25:58 -05:00
|
|
|
|
2017-02-11 07:42:42 -06:00
|
|
|
error: Err(_) will match all errors, maybe not a good idea
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:67:9
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Err(_) => {
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
= note: to remove this warning, match each error separately or use unreachable macro
|
2017-02-11 07:42:42 -06:00
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:66:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(_) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:65:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:65:18
|
2018-10-30 15:36:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-10-30 15:36:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:75:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(_) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:74:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:74:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:82:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(_) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:81:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:81:18
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-12-04 00:17:53 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:88:18
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(_) => println!("ok"),
|
2018-12-09 23:27:19 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:87:18
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-12-09 23:27:19 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:87:18
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Ok(3) => println!("ok"),
|
2018-12-09 23:27:19 -06:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-09-12 07:25:58 -05:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:94:18
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | Ok(_) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-09-12 07:25:58 -05:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:93:18
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | Ok(3) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
2017-09-12 07:25:58 -05:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:93:18
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | 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)
|
2017-09-12 07:25:58 -05:00
|
|
|
|
2017-11-29 14:52:49 -06:00
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:117:29
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | (Ok(_), Some(x)) => println!("ok {}", x),
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-11-29 14:42:37 -06:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:116:29
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | (Ok(x), Some(_)) => println!("ok {}", x),
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2017-11-29 14:42:37 -06:00
|
|
|
note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:116:29
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | (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)
|
2017-11-29 14:42:37 -06:00
|
|
|
|
2017-11-29 15:42:58 -06:00
|
|
|
error: this `match` has identical arm bodies
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:132:18
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | Ok(_) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2017-11-29 15:42:58 -06:00
|
|
|
note: same as this
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:131:18
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | Ok(3) => println!("ok"),
|
|
|
|
| ^^^^^^^^^^^^^^
|
2017-11-29 15:42:58 -06:00
|
|
|
note: consider refactoring into `Ok(3) | Ok(_)`
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/matches.rs:131:18
|
2018-12-27 09:57:55 -06:00
|
|
|
|
|
|
|
|
LL | 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)
|
2017-11-29 15:42:58 -06:00
|
|
|
|
2019-02-16 12:37:58 -06:00
|
|
|
error: you don't need to add `&` to all patterns
|
2019-04-19 05:08:00 -05:00
|
|
|
--> $DIR/matches.rs:160:5
|
2019-02-16 12:37:58 -06:00
|
|
|
|
|
|
|
|
LL | / match foo_variant!(0) {
|
|
|
|
LL | | &Foo::A => println!("A"),
|
|
|
|
LL | | _ => println!("Wild"),
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
|
|
|
|
|
|
|
|
LL | match *foo_variant!(0) {
|
|
|
|
LL | Foo::A => println!("A"),
|
|
|
|
|
|
|
|
|
|
2019-04-19 05:08:00 -05:00
|
|
|
error: aborting due to 18 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|