Use is_lang_item more aggressively

This commit is contained in:
Michael Goulet
2024-06-14 14:46:32 -04:00
parent d5c48ebc71
commit 93ff86ed7c
44 changed files with 171 additions and 166 deletions

View File

@@ -1,4 +1,5 @@
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
use rustc_hir::LangItem;
use rustc_index::bit_set::{BitSet, GrowableBitSet};
use rustc_index::IndexVec;
use rustc_middle::bug;
@@ -70,7 +71,7 @@ fn escaping_locals<'tcx>(
// Exclude #[repr(simd)] types so that they are not de-optimized into an array
return true;
}
if Some(def.did()) == tcx.lang_items().dyn_metadata() {
if tcx.is_lang_item(def.did(), LangItem::DynMetadata) {
// codegen wants to see the `DynMetadata<T>`,
// not the inner reference-to-opaque-type.
return true;