11error: this `if` statement can be collapsed
2- --> tests/ui-toml/collapsible_if/collapsible_if.rs:8 :5
2+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:9 :5
33 |
44LL | / if x == "hello" {
55LL | | // Comment must be kept
2121 |
2222
2323error: this `if` statement can be collapsed
24- --> tests/ui-toml/collapsible_if/collapsible_if.rs:17 :5
24+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:18 :5
2525 |
2626LL | / if x == "hello" { // Inner comment
2727LL | | if y == "world" {
3939 |
4040
4141error: this `if` statement can be collapsed
42- --> tests/ui-toml/collapsible_if/collapsible_if.rs:24 :5
42+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:25 :5
4343 |
4444LL | / if x == "hello" {
4545LL | | /* Inner comment */
5959 |
6060
6161error: this `if` statement can be collapsed
62- --> tests/ui-toml/collapsible_if/collapsible_if.rs:32 :5
62+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:33 :5
6363 |
6464LL | / if x == "hello" { /* Inner comment */
6565LL | | if y == "world" {
@@ -76,5 +76,77 @@ LL | println!("Hello world!");
7676LL ~ }
7777 |
7878
79- error: aborting due to 4 previous errors
79+ error: this `if` statement can be collapsed
80+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:40:5
81+ |
82+ LL | / if true {
83+ LL | | if true {
84+ LL | | println!("No comment, linted");
85+ LL | | }
86+ LL | | }
87+ | |______^
88+ |
89+ help: collapse nested if block
90+ |
91+ LL ~ if true
92+ LL ~ && true {
93+ LL | println!("No comment, linted");
94+ LL ~ }
95+ |
96+
97+ error: this `if` statement can be collapsed
98+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:47:5
99+ |
100+ LL | / if let Some(a) = Some(3) {
101+ LL | | if let Some(b) = Some(4) {
102+ LL | | let _ = a + b;
103+ LL | | }
104+ LL | | }
105+ | |_____^
106+ |
107+ help: collapse nested if block
108+ |
109+ LL ~ if let Some(a) = Some(3)
110+ LL ~ && let Some(b) = Some(4) {
111+ LL | let _ = a + b;
112+ LL ~ }
113+ |
114+
115+ error: this `if` statement can be collapsed
116+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:54:5
117+ |
118+ LL | / if let Some(a) = Some(3) {
119+ LL | | if a + 1 == 4 {
120+ LL | | let _ = a;
121+ LL | | }
122+ LL | | }
123+ | |_____^
124+ |
125+ help: collapse nested if block
126+ |
127+ LL ~ if let Some(a) = Some(3)
128+ LL ~ && a + 1 == 4 {
129+ LL | let _ = a;
130+ LL ~ }
131+ |
132+
133+ error: this `if` statement can be collapsed
134+ --> tests/ui-toml/collapsible_if/collapsible_if.rs:61:5
135+ |
136+ LL | / if Some(3) == Some(4).map(|x| x - 1) {
137+ LL | | if let Some(b) = Some(4) {
138+ LL | | let _ = b;
139+ LL | | }
140+ LL | | }
141+ | |_____^
142+ |
143+ help: collapse nested if block
144+ |
145+ LL ~ if Some(3) == Some(4).map(|x| x - 1)
146+ LL ~ && let Some(b) = Some(4) {
147+ LL | let _ = b;
148+ LL ~ }
149+ |
150+
151+ error: aborting due to 8 previous errors
80152
0 commit comments