@@ -273,12 +273,12 @@ impl<'cx, 'sdt, 'tcx> SigDropChecker<'cx, 'sdt, 'tcx> {
273273
274274 pub ( crate ) fn has_sig_drop_attr ( & mut self , ty : Ty < ' tcx > ) -> bool {
275275 if let Some ( adt) = ty. ty_adt_def ( ) {
276- let iter = get_attr (
276+ let mut iter = get_attr (
277277 self . cx . sess ( ) ,
278278 self . cx . tcx . get_attrs_unchecked ( adt. did ( ) ) ,
279279 "has_significant_drop" ,
280280 ) ;
281- if iter. count ( ) > 0 {
281+ if iter. next ( ) . is_some ( ) {
282282 return true ;
283283 }
284284 }
@@ -360,22 +360,7 @@ impl<'cx, 'sdt, 'tcx> Visitor<'tcx> for SigDropFinder<'cx, 'sdt, 'tcx> {
360360 | hir:: ExprKind :: Yield ( ..) => {
361361 walk_expr ( self , ex) ;
362362 } ,
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+ _ => { } ,
379364 }
380365 }
381366}
0 commit comments