Skip to content

Commit db48b93

Browse files
author
Lukas Markeffsky
committed
improve debug logging
1 parent 6bd970d commit db48b93

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

compiler/rustc_infer/src/infer/relate/higher_ranked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'tcx> InferCtxt<'tcx> {
7777
// that name placeholders created in this function. Nested goals from type relations can
7878
// also contain placeholders created by this function.
7979
let value = self.enter_forall_and_leak_universe(forall);
80-
debug!("?value");
80+
debug!(?value);
8181
f(value)
8282
}
8383

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
14191419

14201420
// returns if `cond` not occurring implies that `error` does not occur - i.e., that
14211421
// `error` occurring implies that `cond` occurs.
1422+
#[instrument(level = "debug", skip(self), ret)]
14221423
fn error_implies(&self, cond: ty::Predicate<'tcx>, error: ty::Predicate<'tcx>) -> bool {
14231424
if cond == error {
14241425
return true;
@@ -1428,25 +1429,13 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
14281429
self.enter_forall(error, |error| {
14291430
elaborate(self.tcx, std::iter::once(cond))
14301431
.filter_map(|implied| implied.to_opt_poly_trait_pred())
1431-
.any(|implied| {
1432-
let is_implied = self.can_match_trait(error, implied);
1433-
if is_implied {
1434-
debug!("error_implies: {:?} -> {:?} -> {:?}", cond, error, implied);
1435-
}
1436-
is_implied
1437-
})
1432+
.any(|implied| self.can_match_trait(error, implied))
14381433
})
14391434
} else if let Some(error) = error.to_opt_poly_projection_pred() {
14401435
self.enter_forall(error, |error| {
14411436
elaborate(self.tcx, std::iter::once(cond))
14421437
.filter_map(|implied| implied.to_opt_poly_projection_pred())
1443-
.any(|implied| {
1444-
let is_implied = self.can_match_projection(error, implied);
1445-
if is_implied {
1446-
debug!("error_implies: {:?} -> {:?} -> {:?}", cond, error, implied);
1447-
}
1448-
is_implied
1449-
})
1438+
.any(|implied| self.can_match_projection(error, implied))
14501439
})
14511440
} else {
14521441
false

0 commit comments

Comments
 (0)