pub use crate::symbol::{Ident, Symbol as Name};
pub use crate::util::parser::ExprPrecedence;
-use crate::ext::hygiene::{ExpnId, SyntaxContext};
+use crate::ext::hygiene::ExpnId;
use crate::parse::token::{self, DelimToken};
use crate::print::pprust;
use crate::ptr::P;
match &self.node {
PatKind::Ident(_, _, Some(p)) => p.walk(it),
- PatKind::Struct(_, fields, _) => fields.iter().all(|field| field.node.pat.walk(it)),
+ PatKind::Struct(_, fields, _) => fields.iter().all(|field| field.pat.walk(it)),
PatKind::TupleStruct(_, s) | PatKind::Tuple(s) | PatKind::Slice(s) => {
s.iter().all(|p| p.walk(it))
}
pub pat: P<Pat>,
pub is_shorthand: bool,
pub attrs: ThinVec<Attribute>,
+ pub id: NodeId,
+ pub span: Span,
}
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
/// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`).
/// The `bool` is `true` in the presence of a `..`.
- Struct(Path, Vec<Spanned<FieldPat>>, /* recovered */ bool),
+ Struct(Path, Vec<FieldPat>, /* recovered */ bool),
/// A tuple struct/variant pattern (`Variant(x, y, .., z)`).
TupleStruct(Path, Vec<P<Pat>>),
pub guard: Option<P<Expr>>,
pub body: P<Expr>,
pub span: Span,
+ pub id: NodeId,
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub span: Span,
pub is_shorthand: bool,
pub attrs: ThinVec<Attribute>,
+ pub id: NodeId,
}
-pub type SpannedIdent = Spanned<Ident>;
-
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
pub enum BlockCheckMode {
Default,
Movable,
}
-pub type Mac = Spanned<Mac_>;
-
/// Represents a macro invocation. The `Path` indicates which macro
/// is being invoked, and the vector of token-trees contains the source
/// of the macro invocation.
/// N.B., the additional ident for a `macro_rules`-style macro is actually
/// stored in the enclosing item.
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
-pub struct Mac_ {
+pub struct Mac {
pub path: Path,
pub delim: MacDelimiter,
pub tts: TokenStream,
+ pub span: Span,
pub prior_type_ascription: Option<(Span, bool)>,
}
Brace,
}
-impl Mac_ {
+impl Mac {
pub fn stream(&self) -> TokenStream {
self.tts.clone()
}
pub volatile: bool,
pub alignstack: bool,
pub dialect: AsmDialect,
- pub ctxt: SyntaxContext,
}
/// An argument in a function header.
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)]
pub struct GlobalAsm {
pub asm: Symbol,
- pub ctxt: SyntaxContext,
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
-pub struct Variant_ {
+pub struct Variant {
/// Name of the variant.
pub ident: Ident,
/// Attributes of the variant.
pub data: VariantData,
/// Explicit discriminant, e.g., `Foo = 1`.
pub disr_expr: Option<AnonConst>,
+ /// Span
+ pub span: Span,
}
-pub type Variant = Spanned<Variant_>;
-
/// Part of `use` item to the right of its prefix.
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub enum UseTreeKind {