Check attributes on struct expression fields.
Attributes on struct expression fields were not being checked for validity. This adds the fields as HIR nodes so that `CheckAttrVisitor` can visit those nodes to check their attributes.
This commit is contained in:
parent
1b464c73b7
commit
b651c1cebe
10 changed files with 47 additions and 18 deletions
|
@ -3332,6 +3332,7 @@ pub enum Node<'hir> {
|
|||
Field(&'hir FieldDef<'hir>),
|
||||
AnonConst(&'hir AnonConst),
|
||||
Expr(&'hir Expr<'hir>),
|
||||
ExprField(&'hir ExprField<'hir>),
|
||||
Stmt(&'hir Stmt<'hir>),
|
||||
PathSegment(&'hir PathSegment<'hir>),
|
||||
Ty(&'hir Ty<'hir>),
|
||||
|
@ -3390,6 +3391,7 @@ impl<'hir> Node<'hir> {
|
|||
| Node::Ctor(..)
|
||||
| Node::Pat(..)
|
||||
| Node::PatField(..)
|
||||
| Node::ExprField(..)
|
||||
| Node::Arm(..)
|
||||
| Node::Local(..)
|
||||
| Node::Crate(..)
|
||||
|
|
|
@ -57,6 +57,7 @@ pub enum Target {
|
|||
MacroDef,
|
||||
Param,
|
||||
PatField,
|
||||
ExprField,
|
||||
}
|
||||
|
||||
impl Display for Target {
|
||||
|
@ -185,6 +186,7 @@ impl Target {
|
|||
Target::MacroDef => "macro def",
|
||||
Target::Param => "function param",
|
||||
Target::PatField => "pattern field",
|
||||
Target::ExprField => "struct field",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue