]> git.lizzy.rs Git - rust.git/commitdiff
more debug dumping in traits
authorNiko Matsakis <niko@alum.mit.edu>
Sat, 21 May 2016 09:42:27 +0000 (05:42 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 31 May 2016 23:43:38 +0000 (19:43 -0400)
src/librustc/traits/fulfill.rs
src/librustc/traits/project.rs

index 0d7d7afd120d28d9e7080d7cd8830fb5a78e06ad..601fd899ff82be0e47f8d6f473615a7461e27c6d 100644 (file)
@@ -171,10 +171,12 @@ pub fn register_predicate_obligation(&mut self,
         // debug output much nicer to read and so on.
         let obligation = infcx.resolve_type_vars_if_possible(&obligation);
 
+        debug!("register_predicate_obligation(obligation={:?})", obligation);
+
         infcx.obligations_in_snapshot.set(true);
 
-        if infcx.tcx.fulfilled_predicates.borrow().check_duplicate(&obligation.predicate)
-        {
+        if infcx.tcx.fulfilled_predicates.borrow().check_duplicate(&obligation.predicate) {
+            debug!("register_predicate_obligation: duplicate");
             return
         }
 
index 1cfdf73ae8e4a1c56ebe14608b086682cd6c571e..011662fe8c2de5bbbc47e8f5fe27e67b43eb2e4b 100644 (file)
@@ -257,9 +257,13 @@ pub fn normalize_with_depth<'a, 'b, 'gcx, 'tcx, T>(
 
     where T : TypeFoldable<'tcx>
 {
+    debug!("normalize_with_depth(depth={}, value={:?})", depth, value);
     let mut normalizer = AssociatedTypeNormalizer::new(selcx, cause, depth);
     let result = normalizer.fold(value);
-
+    debug!("normalize_with_depth: depth={} result={:?} with {} obligations",
+           depth, result, normalizer.obligations.len());
+    debug!("normalize_with_depth: depth={} obligations={:?}",
+           depth, normalizer.obligations);
     Normalized {
         value: result,
         obligations: normalizer.obligations,
@@ -331,13 +335,15 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
                 // binder). It would be better to normalize in a
                 // binding-aware fashion.
 
-                let Normalized { value: ty, obligations } =
+                let Normalized { value: normalized_ty, obligations } =
                     normalize_projection_type(self.selcx,
                                               data.clone(),
                                               self.cause.clone(),
                                               self.depth);
+                debug!("AssociatedTypeNormalizer: depth={} normalized {:?} to {:?} with {} add'l obligations",
+                       self.depth, ty, normalized_ty, obligations.len());
                 self.obligations.extend(obligations);
-                ty
+                normalized_ty
             }
 
             _ => {