Skip to content

Commit

Permalink
cleanup: Remove Def::GlobalAsm
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Aug 4, 2018
1 parent 579adf8 commit 79289b9
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 9 deletions.
6 changes: 1 addition & 5 deletions src/librustc/hir/def.rs
Expand Up @@ -70,8 +70,6 @@ pub enum Def {
Macro(DefId, MacroKind),
NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]`

GlobalAsm(DefId),

// Both namespaces
Err,
}
Expand Down Expand Up @@ -251,8 +249,7 @@ impl Def {
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
}

Expand Down Expand Up @@ -302,7 +299,6 @@ impl Def {
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",
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/map/mod.rs
Expand Up @@ -432,7 +432,6 @@ impl<'hir> Map<'hir> {
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())),
Expand All @@ -445,6 +444,7 @@ impl<'hir> Map<'hir> {
ItemKind::ExternCrate(_) |
ItemKind::Use(..) |
ItemKind::ForeignMod(..) |
ItemKind::GlobalAsm(..) |
ItemKind::Impl(..) => None,
}
}
Expand Down
1 change: 0 additions & 1 deletion src/librustc/ich/impls_hir.rs
Expand Up @@ -1015,7 +1015,6 @@ impl_stable_hash_for!(enum hir::def::Def {
Upvar(def_id, index, expr_id),
Label(node_id),
Macro(def_id, macro_kind),
GlobalAsm(def_id),
ToolMod,
NonMacroAttr,
Err
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/decoder.rs
Expand Up @@ -427,10 +427,10 @@ impl<'tcx> EntryKind<'tcx> {
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(_) |
Expand Down
1 change: 0 additions & 1 deletion src/librustc_save_analysis/lib.rs
Expand Up @@ -810,7 +810,6 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
HirDef::SelfTy(..) |
HirDef::Label(..) |
HirDef::Macro(..) |
HirDef::GlobalAsm(..) |
HirDef::ToolMod |
HirDef::NonMacroAttr |
HirDef::Err => None,
Expand Down

0 comments on commit 79289b9

Please sign in to comment.