From 79289b954505764d3b1fce55e1770586f116a3fa Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Tue, 31 Jul 2018 01:59:41 +0300 Subject: [PATCH] cleanup: Remove `Def::GlobalAsm` --- src/librustc/hir/def.rs | 6 +----- src/librustc/hir/map/mod.rs | 2 +- src/librustc/ich/impls_hir.rs | 1 - src/librustc_metadata/decoder.rs | 2 +- src/librustc_save_analysis/lib.rs | 1 - 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/librustc/hir/def.rs b/src/librustc/hir/def.rs index cb5e1e600d3..b297accc75f 100644 --- a/src/librustc/hir/def.rs +++ b/src/librustc/hir/def.rs @@ -70,8 +70,6 @@ pub enum Def { Macro(DefId, MacroKind), NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]` - GlobalAsm(DefId), - // Both namespaces Err, } @@ -251,8 +249,7 @@ pub fn def_id(&self) -> DefId { 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::Macro(id, ..) | - Def::Existential(id) | Def::AssociatedExistential(id) | - Def::GlobalAsm(id) | Def::TyForeign(id) => { + Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => { id } @@ -302,7 +299,6 @@ pub fn kind_name(&self) -> &'static str { Def::Label(..) => "label", Def::SelfTy(..) => "self type", Def::Macro(.., macro_kind) => macro_kind.descr(), - Def::GlobalAsm(..) => "global asm", Def::ToolMod => "tool module", Def::NonMacroAttr => "non-macro attribute", Def::Err => "unresolved item", diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index 49231e58cf0..b05bcadf826 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -432,7 +432,6 @@ pub fn describe_def(&self, node_id: NodeId) -> Option { ItemKind::Const(..) => Some(Def::Const(def_id())), ItemKind::Fn(..) => Some(Def::Fn(def_id())), ItemKind::Mod(..) => Some(Def::Mod(def_id())), - ItemKind::GlobalAsm(..) => Some(Def::GlobalAsm(def_id())), ItemKind::Existential(..) => Some(Def::Existential(def_id())), ItemKind::Ty(..) => Some(Def::TyAlias(def_id())), ItemKind::Enum(..) => Some(Def::Enum(def_id())), @@ -445,6 +444,7 @@ pub fn describe_def(&self, node_id: NodeId) -> Option { ItemKind::ExternCrate(_) | ItemKind::Use(..) | ItemKind::ForeignMod(..) | + ItemKind::GlobalAsm(..) | ItemKind::Impl(..) => None, } } diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index cac0d182d3a..923cd1e1f83 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -1015,7 +1015,6 @@ fn to_stable_hash_key(&self, Upvar(def_id, index, expr_id), Label(node_id), Macro(def_id, macro_kind), - GlobalAsm(def_id), ToolMod, NonMacroAttr, Err diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index ab566654c38..cf034d94257 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -427,10 +427,10 @@ fn to_def(&self, did: DefId) -> Option { EntryKind::Trait(_) => Def::Trait(did), EntryKind::Enum(..) => Def::Enum(did), EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang), - EntryKind::GlobalAsm => Def::GlobalAsm(did), EntryKind::ForeignType => Def::TyForeign(did), EntryKind::ForeignMod | + EntryKind::GlobalAsm | EntryKind::Impl(_) | EntryKind::Field | EntryKind::Generator(_) | diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 240b33c3c94..f3b71f2641d 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -810,7 +810,6 @@ fn fn_type(path: &ast::Path) -> bool { HirDef::SelfTy(..) | HirDef::Label(..) | HirDef::Macro(..) | - HirDef::GlobalAsm(..) | HirDef::ToolMod | HirDef::NonMacroAttr | HirDef::Err => None,