]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_let_else.stderr
Don't suggest let else in match if the else arm explicitly mentions non obvious paths
[rust.git] / tests / ui / manual_let_else.stderr
1 error: this could be rewritten as `let else`
2   --> $DIR/manual_let_else.rs:17:5
3    |
4 LL |     let v = if let Some(v_some) = g() { v_some } else { return };
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::manual-let-else` implied by `-D warnings`
8
9 error: this could be rewritten as `let else`
10   --> $DIR/manual_let_else.rs:18:5
11    |
12 LL | /     let v = if let Some(v_some) = g() {
13 LL | |         v_some
14 LL | |     } else {
15 LL | |         return;
16 LL | |     };
17    | |______^
18
19 error: this could be rewritten as `let else`
20   --> $DIR/manual_let_else.rs:24:5
21    |
22 LL | /     let v = if let Some(v) = g() {
23 LL | |         // Blocks around the identity should have no impact
24 LL | |         {
25 LL | |             { v }
26 ...  |
27 LL | |         return;
28 LL | |     };
29    | |______^
30
31 error: this could be rewritten as `let else`
32   --> $DIR/manual_let_else.rs:37:9
33    |
34 LL |         let v = if let Some(v_some) = g() { v_some } else { continue };
35    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
37 error: this could be rewritten as `let else`
38   --> $DIR/manual_let_else.rs:38:9
39    |
40 LL |         let v = if let Some(v_some) = g() { v_some } else { break };
41    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43 error: this could be rewritten as `let else`
44   --> $DIR/manual_let_else.rs:42:5
45    |
46 LL |     let v = if let Some(v_some) = g() { v_some } else { panic!() };
47    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48
49 error: this could be rewritten as `let else`
50   --> $DIR/manual_let_else.rs:45:5
51    |
52 LL | /     let v = if let Some(v_some) = g() {
53 LL | |         v_some
54 LL | |     } else {
55 LL | |         std::process::abort()
56 LL | |     };
57    | |______^
58
59 error: this could be rewritten as `let else`
60   --> $DIR/manual_let_else.rs:52:5
61    |
62 LL | /     let v = if let Some(v_some) = g() {
63 LL | |         v_some
64 LL | |     } else {
65 LL | |         if true { return } else { panic!() }
66 LL | |     };
67    | |______^
68
69 error: this could be rewritten as `let else`
70   --> $DIR/manual_let_else.rs:59:5
71    |
72 LL | /     let v = if let Some(v_some) = g() {
73 LL | |         v_some
74 LL | |     } else if true {
75 LL | |         return;
76 LL | |     } else {
77 LL | |         panic!("diverge");
78 LL | |     };
79    | |______^
80
81 error: this could be rewritten as `let else`
82   --> $DIR/manual_let_else.rs:68:5
83    |
84 LL | /     let v = if let Some(v_some) = g() {
85 LL | |         v_some
86 LL | |     } else {
87 LL | |         match (g(), g()) {
88 ...  |
89 LL | |         }
90 LL | |     };
91    | |______^
92
93 error: this could be rewritten as `let else`
94   --> $DIR/manual_let_else.rs:85:5
95    |
96 LL | /     let (v, w) = if let Some(v_some) = g().map(|v| (v, 42)) {
97 LL | |         v_some
98 LL | |     } else {
99 LL | |         return;
100 LL | |     };
101    | |______^
102
103 error: this could be rewritten as `let else`
104   --> $DIR/manual_let_else.rs:92:5
105    |
106 LL | /     let v = if let (Some(v_some), w_some) = (g(), 0) {
107 LL | |         (w_some, v_some)
108 LL | |     } else {
109 LL | |         return;
110 LL | |     };
111    | |______^
112
113 error: this could be rewritten as `let else`
114   --> $DIR/manual_let_else.rs:101:13
115    |
116 LL |             let $n = if let Some(v) = $e { v } else { return };
117    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
118 ...
119 LL |     create_binding_if_some!(w, g());
120    |     ------------------------------- in this macro invocation
121    |
122    = note: this error originates in the macro `create_binding_if_some` (in Nightly builds, run with -Z macro-backtrace for more info)
123
124 error: aborting due to 13 previous errors
125