]> git.lizzy.rs Git - rust.git/blob - tests/ui/if_same_then_else.stderr
iterate List by value
[rust.git] / tests / ui / if_same_then_else.stderr
1 error: this `if` has identical blocks
2   --> $DIR/if_same_then_else.rs:28:12
3    |
4 LL |       } else {
5    |  ____________^
6 LL | |         //~ ERROR same body as `if` block
7 LL | |         Foo { bar: 42 };
8 LL | |         0..10;
9 ...  |
10 LL | |         foo();
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_else.rs:20:13
17    |
18 LL |       if true {
19    |  _____________^
20 LL | |         Foo { bar: 42 };
21 LL | |         0..10;
22 LL | |         ..;
23 ...  |
24 LL | |         foo();
25 LL | |     } else {
26    | |_____^
27
28 error: this `if` has identical blocks
29   --> $DIR/if_same_then_else.rs:66:12
30    |
31 LL |       } else {
32    |  ____________^
33 LL | |         //~ ERROR same body as `if` block
34 LL | |         0.0
35 LL | |     };
36    | |_____^
37    |
38 note: same as this
39   --> $DIR/if_same_then_else.rs:64:21
40    |
41 LL |       let _ = if true {
42    |  _____________________^
43 LL | |         0.0
44 LL | |     } else {
45    | |_____^
46
47 error: this `if` has identical blocks
48   --> $DIR/if_same_then_else.rs:73:12
49    |
50 LL |       } else {
51    |  ____________^
52 LL | |         //~ ERROR same body as `if` block
53 LL | |         -0.0
54 LL | |     };
55    | |_____^
56    |
57 note: same as this
58   --> $DIR/if_same_then_else.rs:71:21
59    |
60 LL |       let _ = if true {
61    |  _____________________^
62 LL | |         -0.0
63 LL | |     } else {
64    | |_____^
65
66 error: this `if` has identical blocks
67   --> $DIR/if_same_then_else.rs:89:12
68    |
69 LL |       } else {
70    |  ____________^
71 LL | |         //~ ERROR same body as `if` block
72 LL | |         42
73 LL | |     };
74    | |_____^
75    |
76 note: same as this
77   --> $DIR/if_same_then_else.rs:87:21
78    |
79 LL |       let _ = if true {
80    |  _____________________^
81 LL | |         42
82 LL | |     } else {
83    | |_____^
84
85 error: this `if` has identical blocks
86   --> $DIR/if_same_then_else.rs:101:12
87    |
88 LL |       } else {
89    |  ____________^
90 LL | |         //~ ERROR same body as `if` block
91 LL | |         let bar = if true { 42 } else { 43 };
92 LL | |
93 ...  |
94 LL | |         bar + 1;
95 LL | |     }
96    | |_____^
97    |
98 note: same as this
99   --> $DIR/if_same_then_else.rs:94:13
100    |
101 LL |       if true {
102    |  _____________^
103 LL | |         let bar = if true { 42 } else { 43 };
104 LL | |
105 LL | |         while foo() {
106 ...  |
107 LL | |         bar + 1;
108 LL | |     } else {
109    | |_____^
110
111 error: aborting due to 5 previous errors
112