Do not run check on foreign items.

This commit is contained in:
Camille GILLOT 2023-12-31 00:22:52 +00:00
parent 7366bdaea2
commit 6dfdeab65a

View File

@ -244,7 +244,7 @@ fn visit_trait_item(&mut self, it: &'tcx TraitItem<'tcx>) {
fn visit_foreign_item(&mut self, it: &'tcx hir::ForeignItem<'tcx>) {
trace!(?it.owner_id);
assert_ne!(it.owner_id.def_id, self.def_id);
self.check(it.owner_id.def_id);
// No need to call `check`, as we do not run borrowck on foreign items.
intravisit::walk_foreign_item(self, it);
}
}