Skip to content

Commit fedcc73

Browse files
committed
tracing: make flag checking less noisy
1 parent b2b859b commit fedcc73

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

compiler/rustc_middle/src/ty/visit.rs

+4-14
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ pub trait TypeVisitable<'tcx>: fmt::Debug + Clone {
8888
self.has_vars_bound_at_or_above(ty::INNERMOST)
8989
}
9090

91-
#[instrument(level = "trace", ret)]
9291
fn has_type_flags(&self, flags: TypeFlags) -> bool {
93-
self.visit_with(&mut HasTypeFlagsVisitor { flags }).break_value() == Some(FoundFlags)
92+
let res =
93+
self.visit_with(&mut HasTypeFlagsVisitor { flags }).break_value() == Some(FoundFlags);
94+
trace!(?self, ?flags, ?res, "has_type_flags");
95+
res
9496
}
9597
fn has_projections(&self) -> bool {
9698
self.has_type_flags(TypeFlags::HAS_PROJECTION)
@@ -560,10 +562,8 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
560562
type BreakTy = FoundFlags;
561563

562564
#[inline]
563-
#[instrument(skip(self), level = "trace", ret)]
564565
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
565566
let flags = t.flags();
566-
trace!(t.flags=?t.flags());
567567
if flags.intersects(self.flags) {
568568
ControlFlow::Break(FoundFlags)
569569
} else {
@@ -572,10 +572,8 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
572572
}
573573

574574
#[inline]
575-
#[instrument(skip(self), level = "trace", ret)]
576575
fn visit_region(&mut self, r: ty::Region<'tcx>) -> ControlFlow<Self::BreakTy> {
577576
let flags = r.type_flags();
578-
trace!(r.flags=?flags);
579577
if flags.intersects(self.flags) {
580578
ControlFlow::Break(FoundFlags)
581579
} else {
@@ -584,7 +582,6 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
584582
}
585583

586584
#[inline]
587-
#[instrument(level = "trace", ret)]
588585
fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {
589586
let flags = FlagComputation::for_const(c);
590587
trace!(r.flags=?flags);
@@ -596,14 +593,7 @@ impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
596593
}
597594

598595
#[inline]
599-
#[instrument(level = "trace", ret)]
600596
fn visit_predicate(&mut self, predicate: ty::Predicate<'tcx>) -> ControlFlow<Self::BreakTy> {
601-
debug!(
602-
"HasTypeFlagsVisitor: predicate={:?} predicate.flags={:?} self.flags={:?}",
603-
predicate,
604-
predicate.flags(),
605-
self.flags
606-
);
607597
if predicate.flags().intersects(self.flags) {
608598
ControlFlow::Break(FoundFlags)
609599
} else {

0 commit comments

Comments
 (0)