Split impl_(opt_)trait_ref

This commit is contained in:
Cameron Steffen
2025-10-13 12:56:21 -05:00
parent ae8ff943c1
commit e60e9f0826
41 changed files with 95 additions and 111 deletions

View File

@@ -44,7 +44,7 @@ impl<'tcx> MirLint<'tcx> for CheckDropRecursion {
// First check if `body` is an `fn drop()` of `Drop`
if let DefKind::AssocFn = tcx.def_kind(def_id)
&& let Some(impl_id) = tcx.trait_impl_of_assoc(def_id.to_def_id())
&& let trait_ref = tcx.impl_trait_ref(impl_id).unwrap()
&& let trait_ref = tcx.impl_trait_ref(impl_id)
&& tcx.is_lang_item(trait_ref.instantiate_identity().def_id, LangItem::Drop)
// avoid erroneous `Drop` impls from causing ICEs below
&& let sig = tcx.fn_sig(def_id).instantiate_identity()