Skip to content

Commit

Permalink
Check should_explore before insert
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ysk committed Nov 17, 2024
1 parent bd0faf4 commit 47d326f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_passes/src/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
}
self.insert_def_id(variant.fields[FieldIdx::from_usize(idx)].did);
}
self.insert_def_id(variant.def_id);
if let Some(def_id) = variant.def_id.as_local() {
if should_explore(self.tcx, def_id) {
self.insert_def_id(variant.def_id);
}
}
}

fn handle_offset_of(&mut self, expr: &'tcx hir::Expr<'tcx>) {
Expand Down

0 comments on commit 47d326f

Please sign in to comment.