about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2023-03-03 12:41:52 -0300
committerSantiago Pastorino <spastorino@gmail.com>2023-03-06 14:49:50 -0300
commitb1efed4b6486c28e661a5020b736b5b3cd671e2b (patch)
treed21405f187c389cf6ea9be4870599d985b02dc61
parent34ca2dc0915e90f3ce170b0bb87d36127b127c36 (diff)
downloadrust-b1efed4b6486c28e661a5020b736b5b3cd671e2b.tar.gz
rust-b1efed4b6486c28e661a5020b736b5b3cd671e2b.zip
Avoid accessing HIR for RPITITs assoc type on mark_live_symbols
-rw-r--r--compiler/rustc_passes/src/dead.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs
index 28e06e5bb3e..13332a2b757 100644
--- a/compiler/rustc_passes/src/dead.rs
+++ b/compiler/rustc_passes/src/dead.rs
@@ -243,6 +243,12 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
                 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
             // tuple struct constructor function
             let id = self.struct_constructors.get(&id).copied().unwrap_or(id);