X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fhir%2Fdef.rs;h=4e0c6479abf141c1e3fff1dfc8e3648389be1622;hb=efa3ec67e28ab8a4c3377a039095cd464713cdfd;hp=c500d770cef0583b2a6e2fe6e9070eb5854845a0;hpb=44eeb2109b249e7496ca0897ce509ced2e3b6c81;p=rust.git diff --git a/src/librustc/hir/def.rs b/src/librustc/hir/def.rs index c500d770cef..4e0c6479abf 100644 --- a/src/librustc/hir/def.rs +++ b/src/librustc/hir/def.rs @@ -9,7 +9,7 @@ // except according to those terms. use hir::def_id::DefId; -use util::nodemap::NodeMap; +use util::nodemap::{NodeMap, DefIdMap}; use syntax::ast; use syntax::ext::base::MacroKind; use syntax_pos::Span; @@ -48,8 +48,9 @@ pub enum Def { VariantCtor(DefId, CtorKind), Method(DefId), AssociatedConst(DefId), - Local(DefId), - Upvar(DefId, // def id of closed over local + + Local(ast::NodeId), + Upvar(ast::NodeId, // node id of closed over local usize, // index in the freevars list of the closure ast::NodeId), // expr node that creates the closure Label(ast::NodeId), @@ -114,7 +115,7 @@ pub fn kind_name(&self) -> &'static str { /// This is the replacement export map. It maps a module to all of the exports /// within. -pub type ExportMap = NodeMap>; +pub type ExportMap = DefIdMap>; #[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)] pub struct Export { @@ -150,11 +151,13 @@ pub fn def_id(&self) -> DefId { Def::Variant(id) | Def::VariantCtor(id, ..) | Def::Enum(id) | Def::TyAlias(id) | Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) | Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) | - Def::AssociatedConst(id) | Def::Local(id) | Def::Upvar(id, ..) | Def::Macro(id, ..) | + Def::AssociatedConst(id) | Def::Macro(id, ..) | Def::GlobalAsm(id) => { id } + Def::Local(..) | + Def::Upvar(..) | Def::Label(..) | Def::PrimTy(..) | Def::SelfTy(..) |