]> git.lizzy.rs Git - rust.git/commitdiff
improved debug output
authorNiko Matsakis <niko@alum.mit.edu>
Thu, 26 Apr 2018 17:31:24 +0000 (13:31 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Thu, 26 Apr 2018 17:31:24 +0000 (13:31 -0400)
src/librustc/traits/fulfill.rs
src/librustc/traits/project.rs
src/librustc_traits/normalize_erasing_regions.rs

index 1c091d68a2ef1474271ff7cb64f858a560c05b67..5ec2e32b6a4c1f20686ee14a503fd3044e7e486e 100644 (file)
@@ -112,7 +112,7 @@ fn select(&mut self, selcx: &mut SelectionContext<'a, 'gcx, 'tcx>)
                 selcx,
                 register_region_obligations: self.register_region_obligations
             });
-            debug!("select: outcome={:?}", outcome);
+            debug!("select: outcome={:#?}", outcome);
 
             // FIXME: if we kept the original cache key, we could mark projection
             // obligations as complete for the projection cache here.
index 1c7942139e97bd8e554003f681d279c3d47066ac..0c35e20324c9ce0a304cd18cdc7f2e1ae60b95f6 100644 (file)
@@ -196,7 +196,10 @@ pub fn poly_project_and_unify_type<'cx, 'gcx, 'tcx>(
                 let span = obligation.cause.span;
                 match infcx.leak_check(false, span, &skol_map, snapshot) {
                     Ok(()) => Ok(infcx.plug_leaks(skol_map, snapshot, result)),
-                    Err(e) => Err(MismatchedProjectionTypes { err: e }),
+                    Err(e) => {
+                        debug!("poly_project_and_unify_type: leak check encountered error {:?}", e);
+                        Err(MismatchedProjectionTypes { err: e })
+                    }
                 }
             }
             Err(e) => {
@@ -243,7 +246,10 @@ fn project_and_unify_type<'cx, 'gcx, 'tcx>(
             obligations.extend(inferred_obligations);
             Ok(Some(obligations))
         },
-        Err(err) => Err(MismatchedProjectionTypes { err: err }),
+        Err(err) => {
+            debug!("project_and_unify_type: equating types encountered error {:?}", err);
+            Err(MismatchedProjectionTypes { err: err })
+        }
     }
 }
 
index 1857df5717bbac2c773d9e623118530ffd96aa83..299433d479dc60d86d69ca5f4cb898482509bb4c 100644 (file)
@@ -17,6 +17,8 @@
     tcx: TyCtxt<'_, 'tcx, 'tcx>,
     goal: ParamEnvAnd<'tcx, Ty<'tcx>>,
 ) -> Ty<'tcx> {
+    debug!("normalize_ty_after_erasing_regions(goal={:#?})", goal);
+
     let ParamEnvAnd { param_env, value } = goal;
     tcx.sess.perf_stats.normalize_ty_after_erasing_regions.fetch_add(1, Ordering::Relaxed);
     tcx.infer_ctxt().enter(|infcx| {