Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
c410-f3r committed Feb 12, 2023
1 parent 078f149 commit 1b286b1
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions clippy_lints/src/significant_drop_tightening.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,12 @@ impl<'cx, 'sdt, 'tcx> SigDropChecker<'cx, 'sdt, 'tcx> {

pub(crate) fn has_sig_drop_attr(&mut self, ty: Ty<'tcx>) -> bool {
if let Some(adt) = ty.ty_adt_def() {
let iter = get_attr(
let mut iter = get_attr(
self.cx.sess(),
self.cx.tcx.get_attrs_unchecked(adt.did()),
"has_significant_drop",
);
if iter.count() > 0 {
if iter.next().is_some() {
return true;
}
}
Expand Down Expand Up @@ -360,22 +360,7 @@ impl<'cx, 'sdt, 'tcx> Visitor<'tcx> for SigDropFinder<'cx, 'sdt, 'tcx> {
| hir::ExprKind::Yield(..) => {
walk_expr(self, ex);
},
hir::ExprKind::AddrOf(_, _, _)
| hir::ExprKind::Block(_, _)
| hir::ExprKind::Break(_, _)
| hir::ExprKind::Cast(_, _)
| hir::ExprKind::Closure { .. }
| hir::ExprKind::ConstBlock(_)
| hir::ExprKind::Continue(_)
| hir::ExprKind::DropTemps(_)
| hir::ExprKind::Err
| hir::ExprKind::InlineAsm(_)
| hir::ExprKind::Let(_)
| hir::ExprKind::Lit(_)
| hir::ExprKind::Loop(_, _, _, _)
| hir::ExprKind::Path(_)
| hir::ExprKind::Struct(_, _, _)
| hir::ExprKind::Type(_, _) => {},
_ => {},
}
}
}

0 comments on commit 1b286b1

Please sign in to comment.