rust/tests/ui/matches.stderr

355 lines
10 KiB
Plaintext
Raw Normal View History

error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
--> $DIR/matches.rs:21:5
|
21 | / match ExprNode::Butterflies {
22 | | ExprNode::ExprAddrOf => Some(&NODE),
23 | | _ => { let x = 5; None },
24 | | }
2017-07-21 03:40:23 -05:00
| |_____^ help: try this: `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
|
= note: `-D single-match-else` implied by `-D warnings`
error: you don't need to add `&` to all patterns
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:30:9
|
2018-04-07 03:23:27 -05:00
30 | / match v {
31 | | &Some(v) => println!("{:?}", v),
32 | | &None => println!("none"),
33 | | }
| |_________^
|
= note: `-D match-ref-pats` implied by `-D warnings`
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-07 03:23:27 -05:00
30 | match *v {
31 | Some(v) => println!("{:?}", v),
32 | None => println!("none"),
|
error: you don't need to add `&` to all patterns
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:40:5
|
2018-04-07 03:23:27 -05:00
40 | / match tup {
41 | | &(v, 1) => println!("{}", v),
42 | | _ => println!("none"),
43 | | }
| |_____^
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
2018-04-07 03:23:27 -05:00
40 | match *tup {
41 | (v, 1) => println!("{}", v),
|
error: you don't need to add `&` to both the expression and the patterns
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:46:5
|
2018-04-07 03:23:27 -05:00
46 | / match &w {
47 | | &Some(v) => println!("{:?}", v),
48 | | &None => println!("none"),
49 | | }
| |_____^
2018-02-04 06:41:54 -06:00
help: try
|
2018-04-07 03:23:27 -05:00
46 | match w {
47 | Some(v) => println!("{:?}", v),
48 | None => println!("none"),
|
error: you don't need to add `&` to all patterns
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:57:5
|
57 | / if let &None = a {
58 | | println!("none");
59 | | }
| |_____^
help: instead of prefixing all patterns with `&`, you can dereference the expression
2018-04-07 03:23:27 -05:00
|
57 | if let None = *a {
2018-05-29 03:56:58 -05:00
| ^^^^ ^^
error: you don't need to add `&` to both the expression and the patterns
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:62:5
|
62 | / if let &None = &b {
63 | | println!("none");
64 | | }
| |_____^
2018-02-04 06:41:54 -06:00
help: try
2018-04-07 03:23:27 -05:00
|
62 | if let None = b {
2018-05-29 03:56:58 -05:00
| ^^^^ ^
error: some ranges overlap
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:71:9
|
71 | 0 ... 10 => println!("0 ... 10"),
| ^^^^^^^^
|
= note: `-D match-overlapping-arm` implied by `-D warnings`
note: overlaps with this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:72:9
|
72 | 0 ... 11 => println!("0 ... 11"),
| ^^^^^^^^
error: some ranges overlap
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:77:9
|
77 | 0 ... 5 => println!("0 ... 5"),
| ^^^^^^^
|
note: overlaps with this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:79:9
|
79 | FOO ... 11 => println!("0 ... 11"),
| ^^^^^^^^^^
error: some ranges overlap
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:85:9
|
85 | 0 ... 5 => println!("0 ... 5"),
| ^^^^^^^
|
note: overlaps with this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:84:9
|
84 | 2 => println!("2"),
| ^
error: some ranges overlap
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:91:9
|
91 | 0 ... 2 => println!("0 ... 2"),
| ^^^^^^^
|
note: overlaps with this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:90:9
|
90 | 2 => println!("2"),
| ^
error: some ranges overlap
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:114:9
|
2018-04-07 03:23:27 -05:00
114 | 0 .. 11 => println!("0 .. 11"),
| ^^^^^^^
|
note: overlaps with this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:115:9
|
2018-04-07 03:23:27 -05:00
115 | 0 ... 11 => println!("0 ... 11"),
| ^^^^^^^^
2017-02-11 00:57:50 -06:00
error: Err(_) will match all errors, maybe not a good idea
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:132:9
2017-02-11 00:57:50 -06:00
|
2018-04-07 03:23:27 -05:00
132 | Err(_) => panic!("err")
2017-02-11 00:57:50 -06:00
| ^^^^^^
|
= note: `-D match-wild-err-arm` implied by `-D warnings`
2017-02-11 00:57:50 -06:00
= note: to remove this warning, match each error seperately or use unreachable macro
2017-09-12 07:25:58 -05:00
error: this `match` has identical arm bodies
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:131:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
131 | Ok(_) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
|
= note: `-D match-same-arms` implied by `-D warnings`
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:130:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
130 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:130:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
130 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
2017-11-29 08:45:12 -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
2017-02-11 00:57:50 -06:00
error: Err(_) will match all errors, maybe not a good idea
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:138:9
2017-02-11 00:57:50 -06:00
|
2018-04-07 03:23:27 -05:00
138 | Err(_) => {panic!()}
2017-02-11 00:57:50 -06:00
| ^^^^^^
|
= note: to remove this warning, match each error seperately or use unreachable macro
2017-09-12 07:25:58 -05:00
error: this `match` has identical arm bodies
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:137:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
137 | Ok(_) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:136:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
136 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:136:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
136 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
2017-11-29 08:45:12 -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
2017-02-11 07:42:42 -06:00
error: Err(_) will match all errors, maybe not a good idea
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:144:9
2017-02-11 07:42:42 -06:00
|
2018-04-07 03:23:27 -05:00
144 | Err(_) => {panic!();}
2017-02-11 07:42:42 -06:00
| ^^^^^^
|
= note: to remove this warning, match each error seperately or use unreachable macro
2017-09-12 07:25:58 -05:00
error: this `match` has identical arm bodies
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:143:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
143 | Ok(_) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:142:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
142 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:142:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
142 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
2017-11-29 08:45:12 -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
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:150:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
150 | Ok(_) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:149:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
149 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:149:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
149 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
2017-11-29 08:45:12 -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
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:157:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
157 | Ok(_) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:156:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
156 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:156:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
156 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
2017-11-29 08:45:12 -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
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:163:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
163 | Ok(_) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:162:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
162 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:162:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
162 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
2017-11-29 08:45:12 -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
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:169:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
169 | Ok(_) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:168:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
168 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:168:18
2017-09-12 07:25:58 -05:00
|
2018-04-07 03:23:27 -05:00
168 | Ok(3) => println!("ok"),
2017-09-12 07:25:58 -05:00
| ^^^^^^^^^^^^^^
2017-11-29 08:45:12 -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
2017-11-29 14:52:49 -06:00
error: this `match` has identical arm bodies
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:190:29
2017-11-29 14:52:49 -06:00
|
2018-04-07 03:23:27 -05:00
190 | (Ok(_), Some(x)) => println!("ok {}", x),
| ^^^^^^^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:189:29
|
2018-04-07 03:23:27 -05:00
189 | (Ok(x), Some(_)) => println!("ok {}", x),
| ^^^^^^^^^^^^^^^^^^^^
note: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:189:29
|
2018-04-07 03:23:27 -05:00
189 | (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
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:205:18
|
2018-04-07 03:23:27 -05:00
205 | Ok(_) => println!("ok"),
| ^^^^^^^^^^^^^^
|
note: same as this
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:204:18
|
2018-04-07 03:23:27 -05:00
204 | Ok(3) => println!("ok"),
| ^^^^^^^^^^^^^^
note: consider refactoring into `Ok(3) | Ok(_)`
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:204:18
|
2018-04-07 03:23:27 -05:00
204 | 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-12-19 16:22:16 -06:00
error: use as_ref() instead
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:212:33
2017-12-19 16:22:16 -06:00
|
2018-04-07 03:23:27 -05:00
212 | let borrowed: Option<&()> = match owned {
2017-12-20 03:39:48 -06:00
| _________________________________^
2018-04-07 03:23:27 -05:00
213 | | None => None,
214 | | Some(ref v) => Some(v),
215 | | };
2017-12-19 16:22:16 -06:00
| |_____^ help: try this: `owned.as_ref()`
|
= note: `-D match-as-ref` implied by `-D warnings`
2017-12-20 03:39:48 -06:00
error: use as_mut() instead
2018-04-07 03:23:27 -05:00
--> $DIR/matches.rs:218:39
2017-12-19 16:22:16 -06:00
|
2018-04-07 03:23:27 -05:00
218 | let borrow_mut: Option<&mut ()> = match mut_owned {
2017-12-20 03:39:48 -06:00
| _______________________________________^
2018-04-07 03:23:27 -05:00
219 | | None => None,
220 | | Some(ref mut v) => Some(v),
221 | | };
2017-12-20 03:39:48 -06:00
| |_____^ help: try this: `mut_owned.as_mut()`
2017-12-19 16:22:16 -06:00
2018-04-07 03:23:27 -05:00
error: aborting due to 25 previous errors
2018-01-16 10:06:27 -06:00