Avoid accessing HIR for RPITITs assoc type on mark_live_symbols

This commit is contained in:
Santiago Pastorino 2023-03-03 12:41:52 -03:00
parent 34ca2dc091
commit b1efed4b64
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -243,6 +243,12 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
continue; continue;
} }
// Avoid accessing the HIR for the synthesized associated type generated for RPITITs.
if self.tcx.opt_rpitit_info(id).is_some() {
self.live_symbols.insert(id);
continue;
}
// in the case of tuple struct constructors we want to check the item, not the generated // in the case of tuple struct constructors we want to check the item, not the generated
// tuple struct constructor function // tuple struct constructor function
let id = self.struct_constructors.get(&id).copied().unwrap_or(id); let id = self.struct_constructors.get(&id).copied().unwrap_or(id);