diff --git a/compiler/rustc_passes/src/dead.rs b/compiler/rustc_passes/src/dead.rs index b1db66fa52d4b..baf312b968638 100644 --- a/compiler/rustc_passes/src/dead.rs +++ b/compiler/rustc_passes/src/dead.rs @@ -265,6 +265,7 @@ impl<'tcx> MarkSymbolVisitor<'tcx> { } self.insert_def_id(variant.fields[FieldIdx::from_usize(idx)].did); } + self.insert_def_id(variant.def_id); } fn handle_offset_of(&mut self, expr: &'tcx hir::Expr<'tcx>) {