File tree Expand file tree Collapse file tree 2 files changed +7
-37
lines changed Expand file tree Collapse file tree 2 files changed +7
-37
lines changed Original file line number Diff line number Diff line change @@ -372,11 +372,13 @@ fn eq_stmts(
372372}
373373
374374fn contains_acceptable_macro ( cx : & LateContext < ' _ > , block : & Block < ' _ > ) -> bool {
375- for stmt in block. stmts {
376- match stmt. kind {
377- StmtKind :: Semi ( semi_expr) if acceptable_macro ( cx, semi_expr) => return true ,
378- _ => { } ,
379- }
375+ if block. stmts . first ( ) . map_or ( false , |stmt|
376+ matches ! (
377+ stmt. kind,
378+ StmtKind :: Semi ( semi_expr) if acceptable_macro( cx, semi_expr)
379+ )
380+ ) {
381+ return true ;
380382 }
381383
382384 if let Some ( block_expr) = block. expr
Original file line number Diff line number Diff line change @@ -179,38 +179,6 @@ mod issue_8836 {
179179 } else {
180180 unimplemented ! ( ) ;
181181 }
182-
183- if true {
184- println ! ( "FOO" ) ;
185- todo ! ( ) ;
186- } else {
187- println ! ( "FOO" ) ;
188- todo ! ( ) ;
189- }
190-
191- if true {
192- println ! ( "FOO" ) ;
193- unimplemented ! ( ) ;
194- } else {
195- println ! ( "FOO" ) ;
196- unimplemented ! ( ) ;
197- }
198-
199- if true {
200- println ! ( "FOO" ) ;
201- todo ! ( )
202- } else {
203- println ! ( "FOO" ) ;
204- todo ! ( )
205- }
206-
207- if true {
208- println ! ( "FOO" ) ;
209- unimplemented ! ( )
210- } else {
211- println ! ( "FOO" ) ;
212- unimplemented ! ( )
213- }
214182 }
215183}
216184
You can’t perform that action at this time.
0 commit comments