From 53f7f8ce5cb01a4bdef70b0bdb4aa812fe548ce7 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 16 Jul 2024 11:31:18 +0000 Subject: [PATCH] Remove an unnecessary impl --- compiler/rustc_middle/src/ty/structural_impls.rs | 6 ------ compiler/rustc_type_ir/src/visit.rs | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 33c04b4111735..00ea87690c1ab 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -632,12 +632,6 @@ impl<'tcx> TypeVisitable> for InferConst { } } -impl<'tcx> TypeSuperVisitable> for ty::UnevaluatedConst<'tcx> { - fn super_visit_with>>(&self, visitor: &mut V) -> V::Result { - self.args.visit_with(visitor) - } -} - impl<'tcx> TypeVisitable> for TyAndLayout<'tcx, Ty<'tcx>> { fn visit_with>>(&self, visitor: &mut V) -> V::Result { visitor.visit_ty(self.ty) diff --git a/compiler/rustc_type_ir/src/visit.rs b/compiler/rustc_type_ir/src/visit.rs index d604199b8e06a..6ec38b78fc22a 100644 --- a/compiler/rustc_type_ir/src/visit.rs +++ b/compiler/rustc_type_ir/src/visit.rs @@ -447,6 +447,15 @@ impl TypeVisitor for HasTypeFlagsVisitor { ControlFlow::Continue(()) } } + + #[inline] + fn visit_error(&mut self, _guar: ::ErrorGuaranteed) -> Self::Result { + if self.flags.intersects(TypeFlags::HAS_ERROR) { + ControlFlow::Break(FoundFlags) + } else { + ControlFlow::Continue(()) + } + } } #[derive(Debug, PartialEq, Eq, Copy, Clone)]