Remove ForeignMod struct.

This commit is contained in:
Camille GILLOT 2020-11-11 22:40:09 +01:00
parent 419a9186a4
commit 032f68d625
26 changed files with 69 additions and 85 deletions

View file

@ -2284,12 +2284,6 @@ pub struct Mod<'hir> {
pub item_ids: &'hir [ItemId],
}
#[derive(Debug, HashStable_Generic)]
pub struct ForeignMod<'hir> {
pub abi: Abi,
pub items: &'hir [ForeignItemRef<'hir>],
}
#[derive(Encodable, Debug, HashStable_Generic)]
pub struct GlobalAsm {
pub asm: Symbol,
@ -2536,7 +2530,7 @@ pub enum ItemKind<'hir> {
/// A module.
Mod(Mod<'hir>),
/// An external module, e.g. `extern { .. }`.
ForeignMod(ForeignMod<'hir>),
ForeignMod { abi: Abi, items: &'hir [ForeignItemRef<'hir>] },
/// Module-level inline assembly (from `global_asm!`).
GlobalAsm(&'hir GlobalAsm),
/// A type alias, e.g., `type Foo = Bar<u8>`.

View file

@ -589,9 +589,9 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item<'v>) {
// `visit_mod()` takes care of visiting the `Item`'s `HirId`.
visitor.visit_mod(module, item.span, item.hir_id)
}
ItemKind::ForeignMod(ref foreign_module) => {
ItemKind::ForeignMod { abi: _, items } => {
visitor.visit_id(item.hir_id);
walk_list!(visitor, visit_foreign_item_ref, foreign_module.items);
walk_list!(visitor, visit_foreign_item_ref, items);
}
ItemKind::GlobalAsm(_) => {
visitor.visit_id(item.hir_id);

View file

@ -91,7 +91,7 @@ impl Target {
ItemKind::Const(..) => Target::Const,
ItemKind::Fn(..) => Target::Fn,
ItemKind::Mod(..) => Target::Mod,
ItemKind::ForeignMod(..) => Target::ForeignMod,
ItemKind::ForeignMod { .. } => Target::ForeignMod,
ItemKind::GlobalAsm(..) => Target::GlobalAsm,
ItemKind::TyAlias(..) => Target::TyAlias,
ItemKind::OpaqueTy(..) => Target::OpaqueTy,