1
Fork 0

Intern LocalDefId list from opaque query

This commit is contained in:
Michael Goulet 2023-10-18 19:28:46 +00:00
parent 64368d0279
commit 18b7d9eb8c
3 changed files with 16 additions and 3 deletions

View file

@ -269,7 +269,10 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for OpaqueTypeCollector<'tcx> {
}
}
fn opaque_types_defined_by<'tcx>(tcx: TyCtxt<'tcx>, item: LocalDefId) -> &'tcx [LocalDefId] {
fn opaque_types_defined_by<'tcx>(
tcx: TyCtxt<'tcx>,
item: LocalDefId,
) -> &'tcx ty::List<LocalDefId> {
let kind = tcx.def_kind(item);
trace!(?kind);
let mut collector = OpaqueTypeCollector::new(tcx, item);
@ -327,7 +330,7 @@ fn opaque_types_defined_by<'tcx>(tcx: TyCtxt<'tcx>, item: LocalDefId) -> &'tcx [
return tcx.opaque_types_defined_by(tcx.local_parent(item));
}
}
tcx.arena.alloc_from_iter(collector.opaques)
tcx.mk_local_def_ids(&collector.opaques)
}
pub(super) fn provide(providers: &mut Providers) {