Skip to content

Commit

Permalink
Fix false "never constructed" warnings for Self:: variant paths
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyab committed Apr 19, 2020
1 parent f742afa commit d3f8db6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_passes/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
hir::ExprKind::Field(ref lhs, ..) => {
self.handle_field_access(&lhs, expr.hir_id);
}
hir::ExprKind::Struct(_, ref fields, _) => {
hir::ExprKind::Struct(ref qpath, ref fields, _) => {
let res = self.tables.qpath_res(qpath, expr.hir_id);
self.handle_res(res);
if let ty::Adt(ref adt, _) = self.tables.expr_ty(expr).kind {
self.mark_as_used_if_union(adt, fields);
}
Expand Down

0 comments on commit d3f8db6

Please sign in to comment.