diff --git a/compiler/rustc_middle/src/ty/visit.rs b/compiler/rustc_middle/src/ty/visit.rs index b302572f3ca..d5553f84f75 100644 --- a/compiler/rustc_middle/src/ty/visit.rs +++ b/compiler/rustc_middle/src/ty/visit.rs @@ -88,9 +88,11 @@ fn has_escaping_bound_vars(&self) -> bool { self.has_vars_bound_at_or_above(ty::INNERMOST) } - #[instrument(level = "trace", ret)] fn has_type_flags(&self, flags: TypeFlags) -> bool { - self.visit_with(&mut HasTypeFlagsVisitor { flags }).break_value() == Some(FoundFlags) + let res = + self.visit_with(&mut HasTypeFlagsVisitor { flags }).break_value() == Some(FoundFlags); + trace!(?self, ?flags, ?res, "has_type_flags"); + res } fn has_projections(&self) -> bool { self.has_type_flags(TypeFlags::HAS_PROJECTION) @@ -560,10 +562,8 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor { type BreakTy = FoundFlags; #[inline] - #[instrument(skip(self), level = "trace", ret)] fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow { let flags = t.flags(); - trace!(t.flags=?t.flags()); if flags.intersects(self.flags) { ControlFlow::Break(FoundFlags) } else { @@ -572,10 +572,8 @@ fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow { } #[inline] - #[instrument(skip(self), level = "trace", ret)] fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow { let flags = r.type_flags(); - trace!(r.flags=?flags); if flags.intersects(self.flags) { ControlFlow::Break(FoundFlags) } else { @@ -584,7 +582,6 @@ fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow { } #[inline] - #[instrument(level = "trace", ret)] fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow { let flags = FlagComputation::for_const(c); trace!(r.flags=?flags); @@ -596,14 +593,7 @@ fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow { } #[inline] - #[instrument(level = "trace", ret)] fn visit_predicate(&mut self, predicate: ty::Predicate<'tcx>) -> ControlFlow { - debug!( - "HasTypeFlagsVisitor: predicate={:?} predicate.flags={:?} self.flags={:?}", - predicate, - predicate.flags(), - self.flags - ); if predicate.flags().intersects(self.flags) { ControlFlow::Break(FoundFlags) } else {