diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-13 16:44:37 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-13 16:44:53 -0400 |
| commit | bac19686a5f7a4cfa7dd4e311769a7e5c50931a3 (patch) | |
| tree | 3d57d963db6e7b9d975c5d1cf40cc78eb0d5b411 /compiler/rustc_lint/src/traits.rs | |
| parent | e08b80c0fb7667bdcd040761891701e576c42ec8 (diff) | |
| download | rust-bac19686a5f7a4cfa7dd4e311769a7e5c50931a3.tar.gz rust-bac19686a5f7a4cfa7dd4e311769a7e5c50931a3.zip | |
Use is_lang_item more
Diffstat (limited to 'compiler/rustc_lint/src/traits.rs')
| -rw-r--r-- | compiler/rustc_lint/src/traits.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/traits.rs b/compiler/rustc_lint/src/traits.rs index fea96b5366e..a0fe4b5af74 100644 --- a/compiler/rustc_lint/src/traits.rs +++ b/compiler/rustc_lint/src/traits.rs @@ -114,7 +114,7 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints { let hir::TyKind::TraitObject(bounds, _lifetime, _syntax) = &ty.kind else { return }; for (bound, modifier) in &bounds[..] { let def_id = bound.trait_ref.trait_def_id(); - if cx.tcx.lang_items().drop_trait() == def_id + if def_id.is_some_and(|def_id| cx.tcx.is_lang_item(def_id, LangItem::Drop)) && *modifier != hir::TraitBoundModifier::Maybe { let Some(def_id) = cx.tcx.get_diagnostic_item(sym::needs_drop) else { return }; |
