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