diff options
| author | Eric Huss <eric@huss.org> | 2022-05-03 11:52:53 -0700 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2022-08-11 21:48:39 -0700 |
| commit | 1b464c73b7f5223d85eb2380af7f448c4be6baf4 (patch) | |
| tree | e87b7cb25393f1e255175f1e071b4d5d231448d9 /compiler/rustc_middle/src/hir | |
| parent | b998821e4c51c44a9ebee395c91323c374236bbb (diff) | |
| download | rust-1b464c73b7f5223d85eb2380af7f448c4be6baf4.tar.gz rust-1b464c73b7f5223d85eb2380af7f448c4be6baf4.zip | |
Check attributes on pattern fields.
Attributes on pattern struct fields were not being checked for validity. This adds the fields as HIR nodes so that the `CheckAttrVisitor` can visit those nodes to check their attributes.
Diffstat (limited to 'compiler/rustc_middle/src/hir')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 47b04c33ec1..06fdef4142e 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -297,6 +297,7 @@ impl<'hir> Map<'hir> { | Node::Infer(_) | Node::TraitRef(_) | Node::Pat(_) + | Node::PatField(_) | Node::Local(_) | Node::Param(_) | Node::Arm(_) @@ -1030,6 +1031,7 @@ impl<'hir> Map<'hir> { Node::TypeBinding(tb) => tb.span, Node::TraitRef(tr) => tr.path.span, Node::Pat(pat) => pat.span, + Node::PatField(field) => field.span, Node::Arm(arm) => arm.span, Node::Block(block) => block.span, Node::Ctor(..) => self.span_with_body(self.get_parent_node(hir_id)), @@ -1247,6 +1249,7 @@ fn hir_id_to_string(map: Map<'_>, id: HirId) -> String { Some(Node::TypeBinding(_)) => node_str("type binding"), Some(Node::TraitRef(_)) => node_str("trait ref"), Some(Node::Pat(_)) => node_str("pat"), + Some(Node::PatField(_)) => node_str("pattern field"), Some(Node::Param(_)) => node_str("param"), Some(Node::Arm(_)) => node_str("arm"), Some(Node::Block(_)) => node_str("block"), |
