about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2024-03-07 13:20:56 +0100
committerLukas Markeffsky <@>2024-03-07 13:20:56 +0100
commitdb48b934544705498dcd3e00527138b48feff3d6 (patch)
tree8029c9dc6105e257fea5de2787c767f37b687e9c
parent6bd970d585816ced1fba673401e6b9e3a566662a (diff)
downloadrust-db48b934544705498dcd3e00527138b48feff3d6.tar.gz
rust-db48b934544705498dcd3e00527138b48feff3d6.zip
improve debug logging
-rw-r--r--compiler/rustc_infer/src/infer/relate/higher_ranked.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs17
2 files changed, 4 insertions, 15 deletions
diff --git a/compiler/rustc_infer/src/infer/relate/higher_ranked.rs b/compiler/rustc_infer/src/infer/relate/higher_ranked.rs
index f30e366c198..cc0f00254ff 100644
--- a/compiler/rustc_infer/src/infer/relate/higher_ranked.rs
+++ b/compiler/rustc_infer/src/infer/relate/higher_ranked.rs
@@ -77,7 +77,7 @@ impl<'tcx> InferCtxt<'tcx> {
         // that name placeholders created in this function. Nested goals from type relations can
         // also contain placeholders created by this function.
         let value = self.enter_forall_and_leak_universe(forall);
-        debug!("?value");
+        debug!(?value);
         f(value)
     }
 
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
index c2059230bfc..5346d2dbd62 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
@@ -1419,6 +1419,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
 
     // returns if `cond` not occurring implies that `error` does not occur - i.e., that
     // `error` occurring implies that `cond` occurs.
+    #[instrument(level = "debug", skip(self), ret)]
     fn error_implies(&self, cond: ty::Predicate<'tcx>, error: ty::Predicate<'tcx>) -> bool {
         if cond == error {
             return true;
@@ -1428,25 +1429,13 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
             self.enter_forall(error, |error| {
                 elaborate(self.tcx, std::iter::once(cond))
                     .filter_map(|implied| implied.to_opt_poly_trait_pred())
-                    .any(|implied| {
-                        let is_implied = self.can_match_trait(error, implied);
-                        if is_implied {
-                            debug!("error_implies: {:?} -> {:?} -> {:?}", cond, error, implied);
-                        }
-                        is_implied
-                    })
+                    .any(|implied| self.can_match_trait(error, implied))
             })
         } else if let Some(error) = error.to_opt_poly_projection_pred() {
             self.enter_forall(error, |error| {
                 elaborate(self.tcx, std::iter::once(cond))
                     .filter_map(|implied| implied.to_opt_poly_projection_pred())
-                    .any(|implied| {
-                        let is_implied = self.can_match_projection(error, implied);
-                        if is_implied {
-                            debug!("error_implies: {:?} -> {:?} -> {:?}", cond, error, implied);
-                        }
-                        is_implied
-                    })
+                    .any(|implied| self.can_match_projection(error, implied))
             })
         } else {
             false