Abstract away differences between Vec and ptr::P in HIR
This commit is contained in:
parent
0d298f9904
commit
6c87b19158
17 changed files with 214 additions and 184 deletions
|
@ -24,7 +24,7 @@ use rustc_front::hir;
|
|||
|
||||
pub struct Module {
|
||||
pub name: Option<Name>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub where_outer: Span,
|
||||
pub where_inner: Span,
|
||||
pub extern_crates: Vec<ExternCrate>,
|
||||
|
@ -58,7 +58,7 @@ impl Module {
|
|||
depr: None,
|
||||
where_outer: syntax::codemap::DUMMY_SP,
|
||||
where_inner: syntax::codemap::DUMMY_SP,
|
||||
attrs : Vec::new(),
|
||||
attrs : hir::HirVec::new(),
|
||||
extern_crates: Vec::new(),
|
||||
imports : Vec::new(),
|
||||
structs : Vec::new(),
|
||||
|
@ -103,8 +103,8 @@ pub struct Struct {
|
|||
pub struct_type: StructType,
|
||||
pub name: Name,
|
||||
pub generics: hir::Generics,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub fields: Vec<hir::StructField>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub fields: hir::HirVec<hir::StructField>,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
||||
|
@ -112,9 +112,9 @@ pub struct Enum {
|
|||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
pub variants: Vec<Variant>,
|
||||
pub variants: hir::HirVec<Variant>,
|
||||
pub generics: hir::Generics,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub id: NodeId,
|
||||
pub whence: Span,
|
||||
pub name: Name,
|
||||
|
@ -122,7 +122,7 @@ pub struct Enum {
|
|||
|
||||
pub struct Variant {
|
||||
pub name: Name,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub def: hir::VariantData,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
|
@ -131,7 +131,7 @@ pub struct Variant {
|
|||
|
||||
pub struct Function {
|
||||
pub decl: hir::FnDecl,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub id: NodeId,
|
||||
pub name: Name,
|
||||
pub vis: hir::Visibility,
|
||||
|
@ -149,7 +149,7 @@ pub struct Typedef {
|
|||
pub gen: hir::Generics,
|
||||
pub name: Name,
|
||||
pub id: ast::NodeId,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
|
@ -162,7 +162,7 @@ pub struct Static {
|
|||
pub mutability: hir::Mutability,
|
||||
pub expr: P<hir::Expr>,
|
||||
pub name: Name,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
|
@ -174,7 +174,7 @@ pub struct Constant {
|
|||
pub type_: P<hir::Ty>,
|
||||
pub expr: P<hir::Expr>,
|
||||
pub name: Name,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
|
@ -185,10 +185,10 @@ pub struct Constant {
|
|||
pub struct Trait {
|
||||
pub unsafety: hir::Unsafety,
|
||||
pub name: Name,
|
||||
pub items: Vec<hir::TraitItem>,
|
||||
pub items: hir::HirVec<hir::TraitItem>,
|
||||
pub generics: hir::Generics,
|
||||
pub bounds: Vec<hir::TyParamBound>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub bounds: hir::HirVec<hir::TyParamBound>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub id: ast::NodeId,
|
||||
pub whence: Span,
|
||||
pub vis: hir::Visibility,
|
||||
|
@ -202,8 +202,8 @@ pub struct Impl {
|
|||
pub generics: hir::Generics,
|
||||
pub trait_: Option<hir::TraitRef>,
|
||||
pub for_: P<hir::Ty>,
|
||||
pub items: Vec<hir::ImplItem>,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub items: hir::HirVec<hir::ImplItem>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
pub vis: hir::Visibility,
|
||||
pub stab: Option<attr::Stability>,
|
||||
|
@ -215,16 +215,16 @@ pub struct DefaultImpl {
|
|||
pub unsafety: hir::Unsafety,
|
||||
pub trait_: hir::TraitRef,
|
||||
pub id: ast::NodeId,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
||||
pub struct Macro {
|
||||
pub name: Name,
|
||||
pub id: ast::NodeId,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
pub matchers: Vec<Span>,
|
||||
pub matchers: hir::HirVec<Span>,
|
||||
pub stab: Option<attr::Stability>,
|
||||
pub depr: Option<attr::Deprecation>,
|
||||
pub imported_from: Option<Name>,
|
||||
|
@ -234,14 +234,14 @@ pub struct ExternCrate {
|
|||
pub name: Name,
|
||||
pub path: Option<String>,
|
||||
pub vis: hir::Visibility,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
||||
pub struct Import {
|
||||
pub id: NodeId,
|
||||
pub vis: hir::Visibility,
|
||||
pub attrs: Vec<ast::Attribute>,
|
||||
pub attrs: hir::HirVec<ast::Attribute>,
|
||||
pub node: hir::ViewPath_,
|
||||
pub whence: Span,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue