]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: this `if` has identical blocks |
2 | --> $DIR/if_same_then_else2.rs:21:12 | |
3 | | | |
4 | LL | } else { | |
5 | | ____________^ | |
6 | LL | | //~ ERROR same body as `if` block | |
7 | LL | | for _ in &[42] { | |
8 | LL | | let bar: &Option<_> = &Some::<u8>(42); | |
9 | ... | | |
10 | LL | | } | |
11 | LL | | } | |
12 | | |_____^ | |
13 | | | |
14 | = note: `-D clippy::if-same-then-else` implied by `-D warnings` | |
15 | note: same as this | |
16 | --> $DIR/if_same_then_else2.rs:12:13 | |
17 | | | |
18 | LL | if true { | |
19 | | _____________^ | |
20 | LL | | for _ in &[42] { | |
21 | LL | | let foo: &Option<_> = &Some::<u8>(42); | |
22 | LL | | if foo.is_some() { | |
23 | ... | | |
24 | LL | | } | |
25 | LL | | } else { | |
26 | | |_____^ | |
27 | ||
28 | error: this `if` has identical blocks | |
29 | --> $DIR/if_same_then_else2.rs:35:12 | |
30 | | | |
31 | LL | } else { | |
32 | | ____________^ | |
33 | LL | | //~ ERROR same body as `if` block | |
34 | LL | | if let Some(a) = Some(42) {} | |
35 | LL | | } | |
36 | | |_____^ | |
37 | | | |
38 | note: same as this | |
39 | --> $DIR/if_same_then_else2.rs:33:13 | |
40 | | | |
41 | LL | if true { | |
42 | | _____________^ | |
43 | LL | | if let Some(a) = Some(42) {} | |
44 | LL | | } else { | |
45 | | |_____^ | |
46 | ||
47 | error: this `if` has identical blocks | |
48 | --> $DIR/if_same_then_else2.rs:42:12 | |
49 | | | |
50 | LL | } else { | |
51 | | ____________^ | |
52 | LL | | //~ ERROR same body as `if` block | |
53 | LL | | if let (1, .., 3) = (1, 2, 3) {} | |
54 | LL | | } | |
55 | | |_____^ | |
56 | | | |
57 | note: same as this | |
58 | --> $DIR/if_same_then_else2.rs:40:13 | |
59 | | | |
60 | LL | if true { | |
61 | | _____________^ | |
62 | LL | | if let (1, .., 3) = (1, 2, 3) {} | |
63 | LL | | } else { | |
64 | | |_____^ | |
65 | ||
66 | error: this `if` has identical blocks | |
67 | --> $DIR/if_same_then_else2.rs:92:12 | |
68 | | | |
69 | LL | } else { | |
70 | | ____________^ | |
71 | LL | | //~ ERROR same body as `if` block | |
72 | LL | | f32::NAN | |
73 | LL | | }; | |
74 | | |_____^ | |
75 | | | |
76 | note: same as this | |
77 | --> $DIR/if_same_then_else2.rs:90:21 | |
78 | | | |
79 | LL | let _ = if true { | |
80 | | _____________________^ | |
81 | LL | | f32::NAN | |
82 | LL | | } else { | |
83 | | |_____^ | |
84 | ||
85 | error: this `if` has identical blocks | |
86 | --> $DIR/if_same_then_else2.rs:99:12 | |
87 | | | |
88 | LL | } else { | |
89 | | ____________^ | |
90 | LL | | //~ ERROR same body as `if` block | |
91 | LL | | Ok("foo")?; | |
92 | LL | | } | |
93 | | |_____^ | |
94 | | | |
95 | note: same as this | |
96 | --> $DIR/if_same_then_else2.rs:97:13 | |
97 | | | |
98 | LL | if true { | |
99 | | _____________^ | |
100 | LL | | Ok("foo")?; | |
101 | LL | | } else { | |
102 | | |_____^ | |
103 | ||
104 | error: this `if` has identical blocks | |
105 | --> $DIR/if_same_then_else2.rs:124:12 | |
106 | | | |
107 | LL | } else { | |
108 | | ____________^ | |
109 | LL | | let foo = ""; | |
110 | LL | | return Ok(&foo[0..]); | |
111 | LL | | } | |
112 | | |_____^ | |
113 | | | |
114 | note: same as this | |
115 | --> $DIR/if_same_then_else2.rs:121:20 | |
116 | | | |
117 | LL | } else if true { | |
118 | | ____________________^ | |
119 | LL | | let foo = ""; | |
120 | LL | | return Ok(&foo[0..]); | |
121 | LL | | } else { | |
122 | | |_____^ | |
123 | ||
124 | error: aborting due to 6 previous errors | |
125 |