Use ItemId as a strongly typed index.

This commit is contained in:
Camille GILLOT 2021-01-30 12:06:04 +01:00
parent ac8961fc04
commit c676e358a5
28 changed files with 63 additions and 51 deletions

View file

@ -588,8 +588,8 @@ impl EmbargoVisitor<'tcx> {
.map(|module_hir_id| self.tcx.hir().expect_item(module_hir_id))
{
if let hir::ItemKind::Mod(m) = &item.kind {
for item_id in m.item_ids {
let item = self.tcx.hir().expect_item(item_id.id);
for &item_id in m.item_ids {
let item = self.tcx.hir().item(item_id);
let def_id = self.tcx.hir().local_def_id(item_id.id);
if !self.tcx.hygienic_eq(segment.ident, item.ident, def_id.to_def_id()) {
continue;