@@ -273,12 +273,12 @@ impl<'cx, 'sdt, 'tcx> SigDropChecker<'cx, 'sdt, 'tcx> {
273
273
274
274
pub ( crate ) fn has_sig_drop_attr ( & mut self , ty : Ty < ' tcx > ) -> bool {
275
275
if let Some ( adt) = ty. ty_adt_def ( ) {
276
- let iter = get_attr (
276
+ let mut iter = get_attr (
277
277
self . cx . sess ( ) ,
278
278
self . cx . tcx . get_attrs_unchecked ( adt. did ( ) ) ,
279
279
"has_significant_drop" ,
280
280
) ;
281
- if iter. count ( ) > 0 {
281
+ if iter. next ( ) . is_some ( ) {
282
282
return true ;
283
283
}
284
284
}
@@ -360,22 +360,7 @@ impl<'cx, 'sdt, 'tcx> Visitor<'tcx> for SigDropFinder<'cx, 'sdt, 'tcx> {
360
360
| hir:: ExprKind :: Yield ( ..) => {
361
361
walk_expr ( self , ex) ;
362
362
} ,
363
- hir:: ExprKind :: AddrOf ( _, _, _)
364
- | hir:: ExprKind :: Block ( _, _)
365
- | hir:: ExprKind :: Break ( _, _)
366
- | hir:: ExprKind :: Cast ( _, _)
367
- | hir:: ExprKind :: Closure { .. }
368
- | hir:: ExprKind :: ConstBlock ( _)
369
- | hir:: ExprKind :: Continue ( _)
370
- | hir:: ExprKind :: DropTemps ( _)
371
- | hir:: ExprKind :: Err
372
- | hir:: ExprKind :: InlineAsm ( _)
373
- | hir:: ExprKind :: Let ( _)
374
- | hir:: ExprKind :: Lit ( _)
375
- | hir:: ExprKind :: Loop ( _, _, _, _)
376
- | hir:: ExprKind :: Path ( _)
377
- | hir:: ExprKind :: Struct ( _, _, _)
378
- | hir:: ExprKind :: Type ( _, _) => { } ,
363
+ _ => { } ,
379
364
}
380
365
}
381
366
}
0 commit comments