rust/tests/ui/result_map_unit_fn.stderr

195 lines
7.5 KiB
Plaintext
Raw Normal View History

2018-04-15 13:00:12 +02:00
error: called `map(f)` on an Result value where `f` is a unit function
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:33:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
33 | x.field.map(do_nothing);
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
|
= note: `-D result-map-unit-fn` implied by `-D warnings`
error: called `map(f)` on an Result value where `f` is a unit function
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:35:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
35 | x.field.map(do_nothing);
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
error: called `map(f)` on an Result value where `f` is a unit function
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:37:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
37 | x.field.map(diverge);
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(x_field) = x.field { diverge(...) }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:43:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
43 | x.field.map(|value| x.do_result_nothing(value + captured));
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:45:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
45 | x.field.map(|value| { x.do_result_plus_one(value + captured); });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:48:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
48 | x.field.map(|value| do_nothing(value + captured));
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:50:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
50 | x.field.map(|value| { do_nothing(value + captured) });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:52:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
52 | x.field.map(|value| { do_nothing(value + captured); });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:54:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
54 | x.field.map(|value| { { do_nothing(value + captured); } });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:57:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
57 | x.field.map(|value| diverge(value + captured));
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:59:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
59 | x.field.map(|value| { diverge(value + captured) });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:61:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
61 | x.field.map(|value| { diverge(value + captured); });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:63:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
63 | x.field.map(|value| { { diverge(value + captured); } });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:68:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
68 | x.field.map(|value| { let y = plus_one(value + captured); });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:70:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
70 | x.field.map(|value| { plus_one(value + captured); });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:72:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
72 | x.field.map(|value| { { plus_one(value + captured); } });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:75:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
75 | x.field.map(|ref value| { do_nothing(value + captured) });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(ref value) = x.field { do_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:78:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
78 | x.field.map(|value| { do_nothing(value); do_nothing(value) });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { ... }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:80:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
80 | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { ... }`
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:84:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
84 | x.field.map(|value| {
2018-04-15 13:00:12 +02:00
| _____^
| |_____|
| ||
2018-04-27 14:00:43 +02:00
85 | || do_nothing(value);
86 | || do_nothing(value)
87 | || });
2018-04-15 13:00:12 +02:00
| ||______^- help: try this: `if let Ok(value) = x.field { ... }`
| |_______|
|
error: called `map(f)` on an Result value where `f` is a unit closure
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:88:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
88 | x.field.map(|value| { do_nothing(value); do_nothing(value); });
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { ... }`
error: called `map(f)` on an Result value where `f` is a unit function
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:92:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
92 | "12".parse::<i32>().map(diverge);
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(_) = "12".parse::<i32>() { diverge(...) }`
error: called `map(f)` on an Result value where `f` is a unit function
2018-04-27 14:00:43 +02:00
--> $DIR/result_map_unit_fn.rs:98:5
2018-04-15 13:00:12 +02:00
|
2018-04-27 14:00:43 +02:00
98 | y.map(do_nothing);
2018-04-15 13:00:12 +02:00
| ^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(_y) = y { do_nothing(...) }`
error: aborting due to 23 previous errors