pub struct Arm {
pub attrs: HirVec<Attribute>,
pub pats: HirVec<P<Pat>>,
- pub guard: Option<P<Expr>>,
+ pub guard: Option<Guard>,
pub body: P<Expr>,
}
+#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
+pub enum Guard {
+ If(P<Expr>),
+}
+
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub struct Field {
pub id: NodeId,
self.flags.contains(CodegenFnAttrFlags::NO_MANGLE) || self.export_name.is_some()
}
}
+
+#[derive(Copy, Clone, Debug)]
+pub enum Node<'hir> {
+ Item(&'hir Item),
+ ForeignItem(&'hir ForeignItem),
+ TraitItem(&'hir TraitItem),
+ ImplItem(&'hir ImplItem),
+ Variant(&'hir Variant),
+ Field(&'hir StructField),
+ AnonConst(&'hir AnonConst),
+ Expr(&'hir Expr),
+ Stmt(&'hir Stmt),
+ Ty(&'hir Ty),
+ TraitRef(&'hir TraitRef),
+ Binding(&'hir Pat),
+ Pat(&'hir Pat),
+ Block(&'hir Block),
+ Local(&'hir Local),
+ MacroDef(&'hir MacroDef),
+
+ /// StructCtor represents a tuple struct.
+ StructCtor(&'hir VariantData),
+
+ Lifetime(&'hir Lifetime),
+ GenericParam(&'hir GenericParam),
+ Visibility(&'hir Visibility),
+
+ Crate,
+}