]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/manual_map_option_2.stderr
New upstream version 1.74.1+dfsg1
[rustc.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:6: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: to override `-D warnings` add `#[allow(clippy::manual_map)]`
16 help: try
17 |
18 LL ~ let _ = Some(0).map(|x| {
19 LL + let y = (String::new(), String::new());
20 LL + (x, y.0)
21 LL ~ });
22 |
23
24 error: manual implementation of `Option::map`
25 --> $DIR/manual_map_option_2.rs:48:13
26 |
27 LL | let _ = match &s {
28 | _____________^
29 LL | | Some(x) => Some({
30 LL | | if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
31 LL | | }),
32 LL | | None => None,
33 LL | | };
34 | |_____^
35 |
36 help: try
37 |
38 LL ~ let _ = s.as_ref().map(|x| {
39 LL + if let Some(ref s) = s { (x.clone(), s) } else { panic!() }
40 LL ~ });
41 |
42
43 error: manual implementation of `Option::map`
44 --> $DIR/manual_map_option_2.rs:60:17
45 |
46 LL | let _ = match Some(0) {
47 | _________________^
48 LL | | Some(x) => Some(f(x)),
49 LL | | None => None,
50 LL | | };
51 | |_________^ help: try: `Some(0).map(|x| f(x))`
52
53 error: manual implementation of `Option::map`
54 --> $DIR/manual_map_option_2.rs:65:13
55 |
56 LL | let _ = match Some(0) {
57 | _____________^
58 LL | | Some(x) => unsafe { Some(f(x)) },
59 LL | | None => None,
60 LL | | };
61 | |_____^ help: try: `Some(0).map(|x| unsafe { f(x) })`
62
63 error: manual implementation of `Option::map`
64 --> $DIR/manual_map_option_2.rs:69:13
65 |
66 LL | let _ = match Some(0) {
67 | _____________^
68 LL | | Some(x) => Some(unsafe { f(x) }),
69 LL | | None => None,
70 LL | | };
71 | |_____^ help: try: `Some(0).map(|x| unsafe { f(x) })`
72
73 error: aborting due to 5 previous errors
74