1
Fork 0

Use is_lang_item more

This commit is contained in:
Michael Goulet 2024-08-13 16:44:37 -04:00
parent e08b80c0fb
commit bac19686a5
12 changed files with 26 additions and 24 deletions

View file

@ -648,7 +648,9 @@ fn characteristic_def_id_of_mono_item<'tcx>(
if let Some(impl_def_id) = tcx.impl_of_method(def_id) {
if tcx.sess.opts.incremental.is_some()
&& tcx.trait_id_of_impl(impl_def_id) == tcx.lang_items().drop_trait()
&& tcx
.trait_id_of_impl(impl_def_id)
.is_some_and(|def_id| tcx.is_lang_item(def_id, LangItem::Drop))
{
// Put `Drop::drop` into the same cgu as `drop_in_place`
// since `drop_in_place` is the only thing that can