Skip to content

Commit 43f4148

Browse files
committed
Auto merge of #52886 - petrochenkov:noga, r=alexcrichton
cleanup: Remove `Def::GlobalAsm` Global asm is not something that needs to have a `Def` or `DefId`.
2 parents 7c98d2e + 79289b9 commit 43f4148

File tree

5 files changed

+3
-9
lines changed

5 files changed

+3
-9
lines changed

Diff for: src/librustc/hir/def.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ pub enum Def {
7070
Macro(DefId, MacroKind),
7171
NonMacroAttr, // e.g. `#[inline]` or `#[rustfmt::skip]`
7272

73-
GlobalAsm(DefId),
74-
7573
// Both namespaces
7674
Err,
7775
}
@@ -251,8 +249,7 @@ impl Def {
251249
Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
252250
Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) |
253251
Def::AssociatedConst(id) | Def::Macro(id, ..) |
254-
Def::Existential(id) | Def::AssociatedExistential(id) |
255-
Def::GlobalAsm(id) | Def::TyForeign(id) => {
252+
Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => {
256253
id
257254
}
258255

@@ -302,7 +299,6 @@ impl Def {
302299
Def::Label(..) => "label",
303300
Def::SelfTy(..) => "self type",
304301
Def::Macro(.., macro_kind) => macro_kind.descr(),
305-
Def::GlobalAsm(..) => "global asm",
306302
Def::ToolMod => "tool module",
307303
Def::NonMacroAttr => "non-macro attribute",
308304
Def::Err => "unresolved item",

Diff for: 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
}

Diff for: 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
ToolMod,
10201019
NonMacroAttr,
10211020
Err

Diff for: 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(_) |

Diff for: 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::ToolMod |
815814
HirDef::NonMacroAttr |
816815
HirDef::Err => None,

0 commit comments

Comments
 (0)