Skip to content

Commit 47d326f

Browse files
committed
Check should_explore before insert
1 parent bd0faf4 commit 47d326f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_passes/src/dead.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
265265
}
266266
self.insert_def_id(variant.fields[FieldIdx::from_usize(idx)].did);
267267
}
268-
self.insert_def_id(variant.def_id);
268+
if let Some(def_id) = variant.def_id.as_local() {
269+
if should_explore(self.tcx, def_id) {
270+
self.insert_def_id(variant.def_id);
271+
}
272+
}
269273
}
270274

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

0 commit comments

Comments
 (0)