]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/matches.stderr
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / matches.stderr
index b5f1f2ab0e731dcbf82f48c836847f5d9dadb06c..06ba6224855a514f860a3278c6d3b0ad1bfd50d3 100644 (file)
-error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
-  --> $DIR/matches.rs:31:5
-   |
-31 | /     match ExprNode::Butterflies {
-32 | |         ExprNode::ExprAddrOf => Some(&NODE),
-33 | |         _ => { let x = 5; None },
-34 | |     }
-   | |_____^ help: try this: `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
-   |
-   = note: `-D clippy::single-match-else` implied by `-D warnings`
-
 error: you don't need to add `&` to all patterns
-  --> $DIR/matches.rs:40:9
+  --> $DIR/matches.rs:20:9
    |
-40 | /         match v {
-41 | |             &Some(v) => println!("{:?}", v),
-42 | |             &None => println!("none"),
-43 | |         }
+LL | /         match v {
+LL | |             &Some(v) => println!("{:?}", v),
+LL | |             &None => println!("none"),
+LL | |         }
    | |_________^
    |
    = note: `-D clippy::match-ref-pats` implied by `-D warnings`
 help: instead of prefixing all patterns with `&`, you can dereference the expression
    |
-40 |         match *v {
-41 |             Some(v) => println!("{:?}", v),
-42 |             None => println!("none"),
+LL |         match *v {
+LL |             Some(v) => println!("{:?}", v),
+LL |             None => println!("none"),
    |
 
-error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
-  --> $DIR/matches.rs:50:5
-   |
-50 | /     match tup {
-51 | |         &(v, 1) => println!("{}", v),
-52 | |         _ => println!("none"),
-53 | |     }
-   | |_____^ help: try this: `if let &(v, 1) = tup { println!("{}", v) } else { println!("none") }`
-
 error: you don't need to add `&` to all patterns
-  --> $DIR/matches.rs:50:5
+  --> $DIR/matches.rs:31:5
    |
-50 | /     match tup {
-51 | |         &(v, 1) => println!("{}", v),
-52 | |         _ => println!("none"),
-53 | |     }
+LL | /     match tup {
+LL | |         &(v, 1) => println!("{}", v),
+LL | |         _ => println!("none"),
+LL | |     }
    | |_____^
 help: instead of prefixing all patterns with `&`, you can dereference the expression
    |
-50 |     match *tup {
-51 |         (v, 1) => println!("{}", v),
+LL |     match *tup {
+LL |         (v, 1) => println!("{}", v),
    |
 
 error: you don't need to add `&` to both the expression and the patterns
-  --> $DIR/matches.rs:56:5
+  --> $DIR/matches.rs:37:5
    |
-56 | /     match &w {
-57 | |         &Some(v) => println!("{:?}", v),
-58 | |         &None => println!("none"),
-59 | |     }
+LL | /     match &w {
+LL | |         &Some(v) => println!("{:?}", v),
+LL | |         &None => println!("none"),
+LL | |     }
    | |_____^
 help: try
    |
-56 |     match w {
-57 |         Some(v) => println!("{:?}", v),
-58 |         None => println!("none"),
+LL |     match w {
+LL |         Some(v) => println!("{:?}", v),
+LL |         None => println!("none"),
    |
 
 error: you don't need to add `&` to all patterns
-  --> $DIR/matches.rs:67:5
+  --> $DIR/matches.rs:48:5
    |
-67 | /     if let &None = a {
-68 | |         println!("none");
-69 | |     }
+LL | /     if let &None = a {
+LL | |         println!("none");
+LL | |     }
    | |_____^
 help: instead of prefixing all patterns with `&`, you can dereference the expression
    |
-67 |     if let None = *a {
+LL |     if let None = *a {
    |            ^^^^   ^^
 
 error: you don't need to add `&` to both the expression and the patterns
-  --> $DIR/matches.rs:72:5
+  --> $DIR/matches.rs:53:5
    |
-72 | /     if let &None = &b {
-73 | |         println!("none");
-74 | |     }
+LL | /     if let &None = &b {
+LL | |         println!("none");
+LL | |     }
    | |_____^
 help: try
    |
-72 |     if let None = b {
+LL |     if let None = b {
    |            ^^^^   ^
 
-error: some ranges overlap
-  --> $DIR/matches.rs:81:9
-   |
-81 |         0 ... 10 => println!("0 ... 10"),
-   |         ^^^^^^^^
-   |
-   = note: `-D clippy::match-overlapping-arm` implied by `-D warnings`
-note: overlaps with this
-  --> $DIR/matches.rs:82:9
-   |
-82 |         0 ... 11 => println!("0 ... 11"),
-   |         ^^^^^^^^
-
-error: some ranges overlap
-  --> $DIR/matches.rs:87:9
-   |
-87 |         0 ... 5 => println!("0 ... 5"),
-   |         ^^^^^^^
+error: Err(_) will match all errors, maybe not a good idea
+  --> $DIR/matches.rs:64:9
    |
-note: overlaps with this
-  --> $DIR/matches.rs:89:9
+LL |         Err(_) => panic!("err"),
+   |         ^^^^^^
    |
-89 |         FOO ... 11 => println!("0 ... 11"),
-   |         ^^^^^^^^^^
+   = note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
+   = note: to remove this warning, match each error separately or use unreachable macro
 
-error: some ranges overlap
-  --> $DIR/matches.rs:95:9
-   |
-95 |         0 ... 5 => println!("0 ... 5"),
-   |         ^^^^^^^
+error: this `match` has identical arm bodies
+  --> $DIR/matches.rs:63:18
    |
-note: overlaps with this
-  --> $DIR/matches.rs:94:9
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
    |
-94 |         2 => println!("2"),
-   |         ^
-
-error: some ranges overlap
-   --> $DIR/matches.rs:101:9
-    |
-101 |         0 ... 2 => println!("0 ... 2"),
-    |         ^^^^^^^
-    |
-note: overlaps with this
-   --> $DIR/matches.rs:100:9
-    |
-100 |         2 => println!("2"),
-    |         ^
-
-error: some ranges overlap
-   --> $DIR/matches.rs:124:9
-    |
-124 |         0 .. 11 => println!("0 .. 11"),
-    |         ^^^^^^^
-    |
-note: overlaps with this
-   --> $DIR/matches.rs:125:9
-    |
-125 |         0 ... 11 => println!("0 ... 11"),
-    |         ^^^^^^^^
-
-error: Err(_) will match all errors, maybe not a good idea
-   --> $DIR/matches.rs:142:9
-    |
-142 |         Err(_) => panic!("err")
-    |         ^^^^^^
-    |
-    = note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
-    = note: to remove this warning, match each error separately or use unreachable macro
-
-error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:141:18
-    |
-141 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
-    = note: `-D clippy::match-same-arms` implied by `-D warnings`
+   = note: `-D clippy::match-same-arms` implied by `-D warnings`
 note: same as this
-   --> $DIR/matches.rs:140:18
-    |
-140 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:62:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:140:18
-    |
-140 |         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)
+  --> $DIR/matches.rs:62:18
+   |
+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)
 
 error: Err(_) will match all errors, maybe not a good idea
-   --> $DIR/matches.rs:148:9
-    |
-148 |         Err(_) => {panic!()}
-    |         ^^^^^^
-    |
-    = note: to remove this warning, match each error separately or use unreachable macro
+  --> $DIR/matches.rs:70:9
+   |
+LL |         Err(_) => panic!(),
+   |         ^^^^^^
+   |
+   = note: to remove this warning, match each error separately or use unreachable macro
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:147:18
-    |
-147 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:69:18
+   |
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:146:18
-    |
-146 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:68:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:146:18
-    |
-146 |         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)
+  --> $DIR/matches.rs:68:18
+   |
+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)
 
 error: Err(_) will match all errors, maybe not a good idea
-   --> $DIR/matches.rs:154:9
-    |
-154 |         Err(_) => {panic!();}
-    |         ^^^^^^
-    |
-    = note: to remove this warning, match each error separately or use unreachable macro
+  --> $DIR/matches.rs:76:9
+   |
+LL |         Err(_) => {
+   |         ^^^^^^
+   |
+   = note: to remove this warning, match each error separately or use unreachable macro
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:153:18
-    |
-153 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:75:18
+   |
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:152:18
-    |
-152 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:74:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:152:18
-    |
-152 |         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)
+  --> $DIR/matches.rs:74:18
+   |
+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)
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:160:18
-    |
-160 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:84:18
+   |
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:159:18
-    |
-159 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:83:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:159:18
-    |
-159 |         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)
+  --> $DIR/matches.rs:83:18
+   |
+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)
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:167:18
-    |
-167 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:91:18
+   |
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:166:18
-    |
-166 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:90:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:166:18
-    |
-166 |         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)
+  --> $DIR/matches.rs:90:18
+   |
+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)
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:173:18
-    |
-173 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:97:18
+   |
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:172:18
-    |
-172 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:96:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:172:18
-    |
-172 |         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)
+  --> $DIR/matches.rs:96:18
+   |
+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)
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:179:18
-    |
-179 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:103:18
+   |
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:178:18
-    |
-178 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:102:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:178:18
-    |
-178 |         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)
+  --> $DIR/matches.rs:102:18
+   |
+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)
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:200:29
-    |
-200 |         (Ok(_), Some(x)) => println!("ok {}", x),
-    |                             ^^^^^^^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:126:29
+   |
+LL |         (Ok(_), Some(x)) => println!("ok {}", x),
+   |                             ^^^^^^^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:199:29
-    |
-199 |         (Ok(x), Some(_)) => println!("ok {}", x),
-    |                             ^^^^^^^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:125:29
+   |
+LL |         (Ok(x), Some(_)) => println!("ok {}", x),
+   |                             ^^^^^^^^^^^^^^^^^^^^
 note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
-   --> $DIR/matches.rs:199:29
-    |
-199 |         (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)
+  --> $DIR/matches.rs:125:29
+   |
+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)
 
 error: this `match` has identical arm bodies
-   --> $DIR/matches.rs:215:18
-    |
-215 |         Ok(_) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
-    |
+  --> $DIR/matches.rs:141:18
+   |
+LL |         Ok(_) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
+   |
 note: same as this
-   --> $DIR/matches.rs:214:18
-    |
-214 |         Ok(3) => println!("ok"),
-    |                  ^^^^^^^^^^^^^^
+  --> $DIR/matches.rs:140:18
+   |
+LL |         Ok(3) => println!("ok"),
+   |                  ^^^^^^^^^^^^^^
 note: consider refactoring into `Ok(3) | Ok(_)`
-   --> $DIR/matches.rs:214:18
-    |
-214 |         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)
+  --> $DIR/matches.rs:140:18
+   |
+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)
 
 error: use as_ref() instead
-   --> $DIR/matches.rs:222:33
-    |
-222 |       let borrowed: Option<&()> = match owned {
-    |  _________________________________^
-223 | |         None => None,
-224 | |         Some(ref v) => Some(v),
-225 | |     };
-    | |_____^ help: try this: `owned.as_ref()`
-    |
-    = note: `-D clippy::match-as-ref` implied by `-D warnings`
+  --> $DIR/matches.rs:150:33
+   |
+LL |       let borrowed: Option<&()> = match owned {
+   |  _________________________________^
+LL | |         None => None,
+LL | |         Some(ref v) => Some(v),
+LL | |     };
+   | |_____^ help: try this: `owned.as_ref()`
+   |
+   = note: `-D clippy::match-as-ref` implied by `-D warnings`
 
 error: use as_mut() instead
-   --> $DIR/matches.rs:228:39
-    |
-228 |       let borrow_mut: Option<&mut ()> = match mut_owned {
-    |  _______________________________________^
-229 | |         None => None,
-230 | |         Some(ref mut v) => Some(v),
-231 | |     };
-    | |_____^ help: try this: `mut_owned.as_mut()`
+  --> $DIR/matches.rs:156:39
+   |
+LL |       let borrow_mut: Option<&mut ()> = match mut_owned {
+   |  _______________________________________^
+LL | |         None => None,
+LL | |         Some(ref mut v) => Some(v),
+LL | |     };
+   | |_____^ help: try this: `mut_owned.as_mut()`
 
-error: aborting due to 26 previous errors
+error: aborting due to 19 previous errors