Skip to content

Commit d3f8db6

Browse files
committed
Fix false "never constructed" warnings for Self:: variant paths
1 parent f742afa commit d3f8db6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_passes/dead.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
255255
hir::ExprKind::Field(ref lhs, ..) => {
256256
self.handle_field_access(&lhs, expr.hir_id);
257257
}
258-
hir::ExprKind::Struct(_, ref fields, _) => {
258+
hir::ExprKind::Struct(ref qpath, ref fields, _) => {
259+
let res = self.tables.qpath_res(qpath, expr.hir_id);
260+
self.handle_res(res);
259261
if let ty::Adt(ref adt, _) = self.tables.expr_ty(expr).kind {
260262
self.mark_as_used_if_union(adt, fields);
261263
}

0 commit comments

Comments
 (0)