]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/manual_map_option_2.stderr
make const_err a hard error
[rust.git] / src / tools / clippy / tests / ui / manual_map_option_2.stderr
1 error: manual implementation of `Option::map`
2   --> $DIR/manual_map_option_2.rs:8:13
3    |
4 LL |       let _ = match Some(0) {
5    |  _____________^
6 LL | |         Some(x) => Some({
7 LL | |             let y = (String::new(), String::new());
8 LL | |             (x, y.0)
9 LL | |         }),
10 LL | |         None => None,
11 LL | |     };
12    | |_____^
13    |
14    = note: `-D clippy::manual-map` implied by `-D warnings`
15 help: try this
16    |
17 LL ~     let _ = Some(0).map(|x| {
18 LL +             let y = (String::new(), String::new());
19 LL +             (x, y.0)
20 LL ~         });
21    |
22
23 error: manual implementation of `Option::map`
24   --> $DIR/manual_map_option_2.rs:50:13
25    |
26 LL |       let _ = match &s {
27    |  _____________^
28 LL | |         Some(x) => Some({
29 LL | |             if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
30 LL | |         }),
31 LL | |         None => None,
32 LL | |     };
33    | |_____^
34    |
35 help: try this
36    |
37 LL ~     let _ = s.as_ref().map(|x| {
38 LL +             if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
39 LL ~         });
40    |
41
42 error: manual implementation of `Option::map`
43   --> $DIR/manual_map_option_2.rs:62:17
44    |
45 LL |           let _ = match Some(0) {
46    |  _________________^
47 LL | |             Some(x) => Some(f(x)),
48 LL | |             None => None,
49 LL | |         };
50    | |_________^ help: try this: `Some(0).map(|x| f(x))`
51
52 error: manual implementation of `Option::map`
53   --> $DIR/manual_map_option_2.rs:67:13
54    |
55 LL |       let _ = match Some(0) {
56    |  _____________^
57 LL | |         Some(x) => unsafe { Some(f(x)) },
58 LL | |         None => None,
59 LL | |     };
60    | |_____^ help: try this: `Some(0).map(|x| unsafe { f(x) })`
61
62 error: manual implementation of `Option::map`
63   --> $DIR/manual_map_option_2.rs:71:13
64    |
65 LL |       let _ = match Some(0) {
66    |  _____________^
67 LL | |         Some(x) => Some(unsafe { f(x) }),
68 LL | |         None => None,
69 LL | |     };
70    | |_____^ help: try this: `Some(0).map(|x| unsafe { f(x) })`
71
72 error: aborting due to 5 previous errors
73