diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-20 20:35:18 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-22 19:48:44 +0000 |
| commit | febb3f7c8814432f5905ecf31137a804c8a5cb1a (patch) | |
| tree | 7d5915d22761a1d5e79e94bc2abdbba17b365ab3 /compiler/rustc_lint/src/traits.rs | |
| parent | 86d69c705a552236a622eee3fdea94bf13c5f102 (diff) | |
| download | rust-febb3f7c8814432f5905ecf31137a804c8a5cb1a.tar.gz rust-febb3f7c8814432f5905ecf31137a804c8a5cb1a.zip | |
Represent TraitBoundModifiers as distinct parts in HIR
Diffstat (limited to 'compiler/rustc_lint/src/traits.rs')
| -rw-r--r-- | compiler/rustc_lint/src/traits.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/traits.rs b/compiler/rustc_lint/src/traits.rs index 5a3666dcbd4..b793ec6a493 100644 --- a/compiler/rustc_lint/src/traits.rs +++ b/compiler/rustc_lint/src/traits.rs @@ -114,10 +114,7 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints { let hir::TyKind::TraitObject(bounds, _lifetime, _syntax) = &ty.kind else { return }; for bound in &bounds[..] { let def_id = bound.trait_ref.trait_def_id(); - if def_id.is_some_and(|def_id| cx.tcx.is_lang_item(def_id, LangItem::Drop)) - // FIXME: ?Drop is not a thing. - && bound.modifiers != hir::TraitBoundModifier::Maybe - { + if def_id.is_some_and(|def_id| cx.tcx.is_lang_item(def_id, LangItem::Drop)) { let Some(def_id) = cx.tcx.get_diagnostic_item(sym::needs_drop) else { return }; cx.emit_span_lint(DYN_DROP, bound.span, DropGlue { tcx: cx.tcx, def_id }); } |
