]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/option_map_unit_fn.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / option_map_unit_fn.stderr
index 5df5ae7d91812617128647be1dabf44f520ae490..16e355ad0b2d37520dc37d715383d69dfac186b7 100644 (file)
@@ -1,7 +1,7 @@
 error: called `map(f)` on an Option value where `f` is a unit function
-  --> $DIR/option_map_unit_fn.rs:41:5
+  --> $DIR/option_map_unit_fn.rs:32:5
    |
-41 |     x.field.map(do_nothing);
+LL |     x.field.map(do_nothing);
    |     ^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(x_field) = x.field { do_nothing(...) }`
@@ -9,202 +9,202 @@ error: called `map(f)` on an Option value where `f` is a unit function
    = note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
 
 error: called `map(f)` on an Option value where `f` is a unit function
-  --> $DIR/option_map_unit_fn.rs:43:5
+  --> $DIR/option_map_unit_fn.rs:34:5
    |
-43 |     x.field.map(do_nothing);
+LL |     x.field.map(do_nothing);
    |     ^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(x_field) = x.field { do_nothing(...) }`
 
 error: called `map(f)` on an Option value where `f` is a unit function
-  --> $DIR/option_map_unit_fn.rs:45:5
+  --> $DIR/option_map_unit_fn.rs:36:5
    |
-45 |     x.field.map(diverge);
+LL |     x.field.map(diverge);
    |     ^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(x_field) = x.field { diverge(...) }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:51:5
+  --> $DIR/option_map_unit_fn.rs:42:5
    |
-51 |     x.field.map(|value| x.do_option_nothing(value + captured));
+LL |     x.field.map(|value| x.do_option_nothing(value + captured));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { x.do_option_nothing(value + captured) }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:53:5
+  --> $DIR/option_map_unit_fn.rs:44:5
    |
-53 |     x.field.map(|value| { x.do_option_plus_one(value + captured); });
+LL |     x.field.map(|value| { x.do_option_plus_one(value + captured); });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { x.do_option_plus_one(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:56:5
+  --> $DIR/option_map_unit_fn.rs:47:5
    |
-56 |     x.field.map(|value| do_nothing(value + captured));
+LL |     x.field.map(|value| do_nothing(value + captured));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:58:5
+  --> $DIR/option_map_unit_fn.rs:49:5
    |
-58 |     x.field.map(|value| { do_nothing(value + captured) });
+LL |     x.field.map(|value| { do_nothing(value + captured) });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:60:5
+  --> $DIR/option_map_unit_fn.rs:51:5
    |
-60 |     x.field.map(|value| { do_nothing(value + captured); });
+LL |     x.field.map(|value| { do_nothing(value + captured); });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:62:5
+  --> $DIR/option_map_unit_fn.rs:53:5
    |
-62 |     x.field.map(|value| { { do_nothing(value + captured); } });
+LL |     x.field.map(|value| { { do_nothing(value + captured); } });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:65:5
+  --> $DIR/option_map_unit_fn.rs:56:5
    |
-65 |     x.field.map(|value| diverge(value + captured));
+LL |     x.field.map(|value| diverge(value + captured));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:67:5
+  --> $DIR/option_map_unit_fn.rs:58:5
    |
-67 |     x.field.map(|value| { diverge(value + captured) });
+LL |     x.field.map(|value| { diverge(value + captured) });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:69:5
+  --> $DIR/option_map_unit_fn.rs:60:5
    |
-69 |     x.field.map(|value| { diverge(value + captured); });
+LL |     x.field.map(|value| { diverge(value + captured); });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:71:5
+  --> $DIR/option_map_unit_fn.rs:62:5
    |
-71 |     x.field.map(|value| { { diverge(value + captured); } });
+LL |     x.field.map(|value| { { diverge(value + captured); } });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:76:5
+  --> $DIR/option_map_unit_fn.rs:67:5
    |
-76 |     x.field.map(|value| { let y = plus_one(value + captured); });
+LL |     x.field.map(|value| { let y = plus_one(value + captured); });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { let y = plus_one(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:78:5
+  --> $DIR/option_map_unit_fn.rs:69:5
    |
-78 |     x.field.map(|value| { plus_one(value + captured); });
+LL |     x.field.map(|value| { plus_one(value + captured); });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:80:5
+  --> $DIR/option_map_unit_fn.rs:71:5
    |
-80 |     x.field.map(|value| { { plus_one(value + captured); } });
+LL |     x.field.map(|value| { { plus_one(value + captured); } });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:83:5
+  --> $DIR/option_map_unit_fn.rs:74:5
    |
-83 |     x.field.map(|ref value| { do_nothing(value + captured) });
+LL |     x.field.map(|ref value| { do_nothing(value + captured) });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(ref value) = x.field { do_nothing(value + captured) }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:86:5
+  --> $DIR/option_map_unit_fn.rs:77:5
    |
-86 |     x.field.map(|value| { do_nothing(value); do_nothing(value) });
+LL |     x.field.map(|value| { do_nothing(value); do_nothing(value) });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { ... }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:88:5
+  --> $DIR/option_map_unit_fn.rs:79:5
    |
-88 |     x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
+LL |     x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { ... }`
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:92:5
+  --> $DIR/option_map_unit_fn.rs:83:5
    |
-92 |        x.field.map(|value| {
+LL |        x.field.map(|value| {
    |   _____^
    |  |_____|
    | ||
-93 | ||         do_nothing(value);
-94 | ||         do_nothing(value)
-95 | ||     });
+LL | ||         do_nothing(value);
+LL | ||         do_nothing(value)
+LL | ||     });
    | ||______^- help: try this: `if let Some(value) = x.field { ... }`
    | |_______|
    | 
 
 error: called `map(f)` on an Option value where `f` is a unit closure
-  --> $DIR/option_map_unit_fn.rs:96:5
+  --> $DIR/option_map_unit_fn.rs:87:5
    |
-96 |     x.field.map(|value| { do_nothing(value); do_nothing(value); });
+LL |     x.field.map(|value| { do_nothing(value); do_nothing(value); });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(value) = x.field { ... }`
 
 error: called `map(f)` on an Option value where `f` is a unit function
-  --> $DIR/option_map_unit_fn.rs:99:5
+  --> $DIR/option_map_unit_fn.rs:90:5
    |
-99 |     Some(42).map(diverge);
+LL |     Some(42).map(diverge);
    |     ^^^^^^^^^^^^^^^^^^^^^-
    |     |
    |     help: try this: `if let Some(_) = Some(42) { diverge(...) }`
 
 error: called `map(f)` on an Option value where `f` is a unit function
-   --> $DIR/option_map_unit_fn.rs:100:5
-    |
-100 |     "12".parse::<i32>().ok().map(diverge);
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
-    |     |
-    |     help: try this: `if let Some(_) = "12".parse::<i32>().ok() { diverge(...) }`
+  --> $DIR/option_map_unit_fn.rs:91:5
+   |
+LL |     "12".parse::<i32>().ok().map(diverge);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
+   |     |
+   |     help: try this: `if let Some(_) = "12".parse::<i32>().ok() { diverge(...) }`
 
 error: called `map(f)` on an Option value where `f` is a unit function
-   --> $DIR/option_map_unit_fn.rs:101:5
-    |
-101 |     Some(plus_one(1)).map(do_nothing);
-    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
-    |     |
-    |     help: try this: `if let Some(_) = Some(plus_one(1)) { do_nothing(...) }`
+  --> $DIR/option_map_unit_fn.rs:92:5
+   |
+LL |     Some(plus_one(1)).map(do_nothing);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
+   |     |
+   |     help: try this: `if let Some(_) = Some(plus_one(1)) { do_nothing(...) }`
 
 error: called `map(f)` on an Option value where `f` is a unit function
-   --> $DIR/option_map_unit_fn.rs:105:5
-    |
-105 |     y.map(do_nothing);
-    |     ^^^^^^^^^^^^^^^^^-
-    |     |
-    |     help: try this: `if let Some(_y) = y { do_nothing(...) }`
+  --> $DIR/option_map_unit_fn.rs:96:5
+   |
+LL |     y.map(do_nothing);
+   |     ^^^^^^^^^^^^^^^^^-
+   |     |
+   |     help: try this: `if let Some(_y) = y { do_nothing(...) }`
 
 error: aborting due to 25 previous errors