From 6dfdeab65a5e08efa811e033417bd7aef5d3c1fa Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 31 Dec 2023 00:22:52 +0000 Subject: [PATCH] Do not run check on foreign items. --- compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs index 04047e56c60ea..da7279967dac1 100644 --- a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs +++ b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs @@ -244,7 +244,7 @@ impl<'tcx> intravisit::Visitor<'tcx> for TaitConstraintLocator<'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); } }