mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Fix diagnostic that was looking for a PatKind::Struct
Now that fields are first-class HIR nodes, they appear before the struct pat.
This commit is contained in:
parent
c655f17bce
commit
1c70b8669a
@ -927,7 +927,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
),
|
||||
);
|
||||
match self.tcx.hir().get(self.tcx.hir().get_parent_node(pat.hir_id)) {
|
||||
hir::Node::Pat(Pat { kind: hir::PatKind::Struct(..), .. }) => {
|
||||
hir::Node::PatField(..) => {
|
||||
e.span_suggestion_verbose(
|
||||
ident.span.shrink_to_hi(),
|
||||
"bind the struct field to a different name instead",
|
||||
|
Loading…
Reference in New Issue
Block a user