]> git.lizzy.rs Git - rust.git/commitdiff
cleanup: Remove `Def::GlobalAsm`
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Mon, 30 Jul 2018 22:59:41 +0000 (01:59 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 4 Aug 2018 11:31:30 +0000 (14:31 +0300)
src/librustc/hir/def.rs
src/librustc/hir/map/mod.rs
src/librustc/ich/impls_hir.rs
src/librustc_metadata/decoder.rs
src/librustc_save_analysis/lib.rs

index cb5e1e600d3d2e8659b21d7bdcc8cc84231dd5a3..b297accc75fd5a2a100df19f7525a62a6329ec73 100644 (file)
@@ -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",
index 49231e58cf0fc574d39cad754c6f46cea58dbf22..b05bcadf82649daa57cb8573a60d2a613ce8263a 100644 (file)
@@ -432,7 +432,6 @@ pub fn describe_def(&self, node_id: NodeId) -> Option<Def> {
                     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<Def> {
                     ItemKind::ExternCrate(_) |
                     ItemKind::Use(..) |
                     ItemKind::ForeignMod(..) |
+                    ItemKind::GlobalAsm(..) |
                     ItemKind::Impl(..) => None,
                 }
             }
index cac0d182d3a48923c43ad897e4c7ab32dc0cf4a1..923cd1e1f83974a21194c064aafc0dab221ebef7 100644 (file)
@@ -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
index ab566654c389cd366c5be633b33149f4bb57f922..cf034d9425759b19ac97c2cbe3d01dfbd79b6f71 100644 (file)
@@ -427,10 +427,10 @@ fn to_def(&self, did: DefId) -> Option<Def> {
             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(_) |
index 240b33c3c9478ca50ae950f9d1d11c361e0bd51f..f3b71f2641d41c47606edf872b9ec636e43eccf9 100644 (file)
@@ -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,