Resolve attributes in several places

Arm, Field, FieldPat, GenericParam, Param, StructField and Variant
This commit is contained in:
Caio 2019-09-09 09:26:25 -03:00
parent 2c0931e168
commit 63a5f399ae
37 changed files with 1135 additions and 527 deletions

View file

@ -352,7 +352,7 @@ pub struct GenericParam {
pub ident: Ident,
pub attrs: ThinVec<Attribute>,
pub bounds: GenericBounds,
pub is_placeholder: bool,
pub kind: GenericParamKind,
}
@ -613,6 +613,7 @@ pub struct FieldPat {
pub attrs: ThinVec<Attribute>,
pub id: NodeId,
pub span: Span,
pub is_placeholder: bool,
}
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
@ -935,6 +936,7 @@ pub struct Arm {
pub body: P<Expr>,
pub span: Span,
pub id: NodeId,
pub is_placeholder: bool,
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
@ -945,6 +947,7 @@ pub struct Field {
pub is_shorthand: bool,
pub attrs: ThinVec<Attribute>,
pub id: NodeId,
pub is_placeholder: bool,
}
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
@ -1798,6 +1801,7 @@ pub struct Param {
pub pat: P<Pat>,
pub id: NodeId,
pub span: Span,
pub is_placeholder: bool,
}
/// Alternative representation for `Arg`s describing `self` parameter of methods.
@ -1859,6 +1863,7 @@ impl Param {
span,
ty,
id: DUMMY_NODE_ID,
is_placeholder: false
};
match eself.node {
SelfKind::Explicit(ty, mutbl) => param(mutbl, ty),
@ -2054,6 +2059,8 @@ pub struct Variant {
pub disr_expr: Option<AnonConst>,
/// Span
pub span: Span,
/// Is a macro placeholder
pub is_placeholder: bool,
}
/// Part of `use` item to the right of its prefix.
@ -2216,6 +2223,7 @@ pub struct StructField {
pub id: NodeId,
pub ty: P<Ty>,
pub attrs: Vec<Attribute>,
pub is_placeholder: bool,
}
/// Fields and constructor ids of enum variants and structs.