Skip to content

Commit ef6fddd

Browse files
committed
cleanup: Remove Def::GlobalAsm
1 parent 54628c8 commit ef6fddd

File tree

6 files changed

+5
-16
lines changed

6 files changed

+5
-16
lines changed

src/librustc/hir/def.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ pub enum Def {
6868
// Macro namespace
6969
Macro(DefId, MacroKind),
7070

71-
GlobalAsm(DefId),
72-
7371
// Both namespaces
7472
Err,
7573
}
@@ -249,8 +247,7 @@ impl Def {
249247
Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
250248
Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) |
251249
Def::AssociatedConst(id) | Def::Macro(id, ..) |
252-
Def::Existential(id) | Def::AssociatedExistential(id) |
253-
Def::GlobalAsm(id) | Def::TyForeign(id) => {
250+
Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => {
254251
id
255252
}
256253

@@ -298,7 +295,6 @@ impl Def {
298295
Def::Label(..) => "label",
299296
Def::SelfTy(..) => "self type",
300297
Def::Macro(.., macro_kind) => macro_kind.descr(),
301-
Def::GlobalAsm(..) => "global asm",
302298
Def::Err => "unresolved item",
303299
}
304300
}

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ impl<'hir> Map<'hir> {
432432
ItemKind::Const(..) => Some(Def::Const(def_id())),
433433
ItemKind::Fn(..) => Some(Def::Fn(def_id())),
434434
ItemKind::Mod(..) => Some(Def::Mod(def_id())),
435-
ItemKind::GlobalAsm(..) => Some(Def::GlobalAsm(def_id())),
436435
ItemKind::Existential(..) => Some(Def::Existential(def_id())),
437436
ItemKind::Ty(..) => Some(Def::TyAlias(def_id())),
438437
ItemKind::Enum(..) => Some(Def::Enum(def_id())),
@@ -445,6 +444,7 @@ impl<'hir> Map<'hir> {
445444
ItemKind::ExternCrate(_) |
446445
ItemKind::Use(..) |
447446
ItemKind::ForeignMod(..) |
447+
ItemKind::GlobalAsm(..) |
448448
ItemKind::Impl(..) => None,
449449
}
450450
}

src/librustc/ich/impls_hir.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,6 @@ impl_stable_hash_for!(enum hir::def::Def {
10151015
Upvar(def_id, index, expr_id),
10161016
Label(node_id),
10171017
Macro(def_id, macro_kind),
1018-
GlobalAsm(def_id),
10191018
Err
10201019
});
10211020

src/librustc_metadata/decoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,10 @@ impl<'tcx> EntryKind<'tcx> {
427427
EntryKind::Trait(_) => Def::Trait(did),
428428
EntryKind::Enum(..) => Def::Enum(did),
429429
EntryKind::MacroDef(_) => Def::Macro(did, MacroKind::Bang),
430-
EntryKind::GlobalAsm => Def::GlobalAsm(did),
431430
EntryKind::ForeignType => Def::TyForeign(did),
432431

433432
EntryKind::ForeignMod |
433+
EntryKind::GlobalAsm |
434434
EntryKind::Impl(_) |
435435
EntryKind::Field |
436436
EntryKind::Generator(_) |

src/librustc_resolve/lib.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,10 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
200200
err.span_label(typaram_span, "type variable from outer function");
201201
}
202202
},
203-
Def::Mod(..) | Def::Struct(..) | Def::Union(..) | Def::Enum(..) | Def::Variant(..) |
204-
Def::Trait(..) | Def::TyAlias(..) | Def::TyForeign(..) | Def::TraitAlias(..) |
205-
Def::AssociatedTy(..) | Def::PrimTy(..) | Def::Fn(..) | Def::Const(..) |
206-
Def::Static(..) | Def::StructCtor(..) | Def::VariantCtor(..) | Def::Method(..) |
207-
Def::AssociatedConst(..) | Def::Local(..) | Def::Upvar(..) | Def::Label(..) |
208-
Def::Existential(..) | Def::AssociatedExistential(..) |
209-
Def::Macro(..) | Def::GlobalAsm(..) | Def::Err =>
203+
_ => {
210204
bug!("TypeParametersFromOuterFunction should only be used with Def::SelfTy or \
211205
Def::TyParam")
206+
}
212207
}
213208

214209
// Try to retrieve the span of the function signature and generate a new message with

src/librustc_save_analysis/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,6 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
810810
HirDef::SelfTy(..) |
811811
HirDef::Label(..) |
812812
HirDef::Macro(..) |
813-
HirDef::GlobalAsm(..) |
814813
HirDef::Err => None,
815814
}
816815
}

0 commit comments

Comments
 (0)