Remove ForeignMod struct.
This commit is contained in:
parent
419a9186a4
commit
032f68d625
26 changed files with 69 additions and 85 deletions
|
@ -746,21 +746,21 @@ pub fn check_item_type<'tcx>(tcx: TyCtxt<'tcx>, it: &'tcx hir::Item<'tcx>) {
|
|||
let generics = tcx.generics_of(def_id);
|
||||
check_type_params_are_used(tcx, &generics, pty_ty);
|
||||
}
|
||||
hir::ItemKind::ForeignMod(ref m) => {
|
||||
check_abi(tcx, it.span, m.abi);
|
||||
hir::ItemKind::ForeignMod { abi, items } => {
|
||||
check_abi(tcx, it.span, abi);
|
||||
|
||||
if m.abi == Abi::RustIntrinsic {
|
||||
for item in m.items {
|
||||
if abi == Abi::RustIntrinsic {
|
||||
for item in items {
|
||||
let item = tcx.hir().foreign_item(item.id);
|
||||
intrinsic::check_intrinsic_type(tcx, item);
|
||||
}
|
||||
} else if m.abi == Abi::PlatformIntrinsic {
|
||||
for item in m.items {
|
||||
} else if abi == Abi::PlatformIntrinsic {
|
||||
for item in items {
|
||||
let item = tcx.hir().foreign_item(item.id);
|
||||
intrinsic::check_platform_intrinsic_type(tcx, item);
|
||||
}
|
||||
} else {
|
||||
for item in m.items {
|
||||
for item in items {
|
||||
let def_id = tcx.hir().local_def_id(item.id.hir_id);
|
||||
let generics = tcx.generics_of(def_id);
|
||||
let own_counts = generics.own_counts();
|
||||
|
@ -796,7 +796,7 @@ pub fn check_item_type<'tcx>(tcx: TyCtxt<'tcx>, it: &'tcx hir::Item<'tcx>) {
|
|||
let item = tcx.hir().foreign_item(item.id);
|
||||
match item.kind {
|
||||
hir::ForeignItemKind::Fn(ref fn_decl, _, _) => {
|
||||
require_c_abi_if_c_variadic(tcx, fn_decl, m.abi, item.span);
|
||||
require_c_abi_if_c_variadic(tcx, fn_decl, abi, item.span);
|
||||
}
|
||||
hir::ForeignItemKind::Static(..) => {
|
||||
check_static_inhabited(tcx, def_id, item.span);
|
||||
|
|
|
@ -156,8 +156,8 @@ pub fn check_item_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
|
|||
hir::ItemKind::Const(ref ty, ..) => {
|
||||
check_item_type(tcx, item.hir_id, ty.span, false);
|
||||
}
|
||||
hir::ItemKind::ForeignMod(ref module) => {
|
||||
for it in module.items.iter() {
|
||||
hir::ItemKind::ForeignMod { items, .. } => {
|
||||
for it in items.iter() {
|
||||
let it = tcx.hir().foreign_item(it.id);
|
||||
match it.kind {
|
||||
hir::ForeignItemKind::Fn(ref decl, ..) => {
|
||||
|
|
|
@ -646,8 +646,8 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::HirId) {
|
|||
| hir::ItemKind::Use(..)
|
||||
| hir::ItemKind::Mod(_)
|
||||
| hir::ItemKind::GlobalAsm(_) => {}
|
||||
hir::ItemKind::ForeignMod(ref foreign_mod) => {
|
||||
for item in foreign_mod.items {
|
||||
hir::ItemKind::ForeignMod { items, .. } => {
|
||||
for item in items {
|
||||
let item = tcx.hir().foreign_item(item.id);
|
||||
let def_id = tcx.hir().local_def_id(item.hir_id);
|
||||
tcx.ensure().generics_of(def_id);
|
||||
|
|
|
@ -259,7 +259,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
|
|||
ItemKind::Trait(..)
|
||||
| ItemKind::TraitAlias(..)
|
||||
| ItemKind::Mod(..)
|
||||
| ItemKind::ForeignMod(..)
|
||||
| ItemKind::ForeignMod { .. }
|
||||
| ItemKind::GlobalAsm(..)
|
||||
| ItemKind::ExternCrate(..)
|
||||
| ItemKind::Use(..) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue