]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_passes/src/hir_id_validator.rs
Do not visit ForeignItemRef for HIR indexing and validation.
[rust.git] / compiler / rustc_passes / src / hir_id_validator.rs
index c7e057927ab42065d330075261710d03d4e9526c..fdd6c2380556473da5fdb0e00c2b42de067c0c4c 100644 (file)
@@ -169,6 +169,13 @@ fn visit_impl_item_ref(&mut self, _: &'hir hir::ImplItemRef<'hir>) {
         // different owner.
     }
 
+    fn visit_foreign_item_ref(&mut self, _: &'hir hir::ForeignItemRef<'hir>) {
+        // Explicitly do nothing here. ForeignItemRefs contain hir::Visibility
+        // values that actually belong to an ForeignItem instead of the ItemKind::ForeignMod
+        // we are currently in. So for those it's correct that they have a
+        // different owner.
+    }
+
     fn visit_generic_param(&mut self, param: &'hir hir::GenericParam<'hir>) {
         if let hir::GenericParamKind::Type {
             synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),