Skip to content

Commit 1c70b86

Browse files
committed
Fix diagnostic that was looking for a PatKind::Struct
Now that fields are first-class HIR nodes, they appear before the struct pat.
1 parent c655f17 commit 1c70b86

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_typeck/src/check

1 file changed

+1
-1
lines changed

compiler/rustc_typeck/src/check/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
927927
),
928928
);
929929
match self.tcx.hir().get(self.tcx.hir().get_parent_node(pat.hir_id)) {
930-
hir::Node::Pat(Pat { kind: hir::PatKind::Struct(..), .. }) => {
930+
hir::Node::PatField(..) => {
931931
e.span_suggestion_verbose(
932932
ident.span.shrink_to_hi(),
933933
"bind the struct field to a different name instead",

0 commit comments

Comments
 (0)