about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLindsey Kuper <lindsey@rockstargirl.org>2012-08-17 11:34:25 -0700
committerLindsey Kuper <lindsey@rockstargirl.org>2012-08-17 14:32:34 -0700
commit2b3c86cb02803e569d4f5b6891d439c9daa0b90a (patch)
tree47057bd9d59bc4bda65afc109b7e7eaa8001d570
parent6f441e8fde85aac3321b1aad42eaa25d88d0a716 (diff)
downloadrust-2b3c86cb02803e569d4f5b6891d439c9daa0b90a.tar.gz
rust-2b3c86cb02803e569d4f5b6891d439c9daa0b90a.zip
More and better debug messages for method typechecking
-rw-r--r--src/rustc/middle/typeck/check/method.rs24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/rustc/middle/typeck/check/method.rs b/src/rustc/middle/typeck/check/method.rs
index 9dd2cec043c..261e6eae994 100644
--- a/src/rustc/middle/typeck/check/method.rs
+++ b/src/rustc/middle/typeck/check/method.rs
@@ -174,7 +174,11 @@ struct lookup {
                 (optional_inherent_methods, subtyping_mode);
 
             // if we found anything, stop before trying borrows
-            if self.candidates.len() > 0u { break; }
+            if self.candidates.len() > 0u {
+                debug!{"(checking method) found at least one inherent \
+                        method; giving up looking now"};
+                break;
+            }
 
             // Again, look for inherent and extension methods, this time using
             // assignability.
@@ -198,7 +202,11 @@ struct lookup {
                 (optional_inherent_methods, mutable_reference_mode);
 
             // if we found anything, stop before attempting auto-deref.
-            if self.candidates.len() > 0u { break; }
+            if self.candidates.len() > 0u {
+                debug!{"(checking method) found at least one inherent \
+                        method; giving up looking now"};
+                break;
+            }
 
             // check whether we can autoderef and if so loop around again.
             match ty::deref(self.tcx(), self.self_ty, false) {
@@ -210,7 +218,11 @@ struct lookup {
             }
         }
 
-        if self.candidates.len() == 0u { return none; }
+        if self.candidates.len() == 0u {
+            debug!{"(checking method) couldn't find any candidate methods; \
+                    returning none"};
+            return none;
+        }
 
         if self.candidates.len() > 1u {
             self.tcx().sess.span_err(
@@ -270,7 +282,7 @@ struct lookup {
     }
 
     fn add_candidates_from_param(n: uint, did: ast::def_id) {
-        debug!{"candidates_from_param"};
+        debug!{"add_candidates_from_param"};
 
         let tcx = self.tcx();
         let mut trait_bnd_idx = 0u; // count only trait bounds
@@ -320,7 +332,7 @@ struct lookup {
 
     fn add_candidates_from_trait(did: ast::def_id, trait_substs: ty::substs) {
 
-        debug!{"method_from_trait"};
+        debug!{"add_candidates_from_trait"};
 
         let ms = *ty::trait_methods(self.tcx(), did);
         for ms.eachi |i, m| {
@@ -355,7 +367,7 @@ struct lookup {
 
     fn add_candidates_from_class(did: ast::def_id, class_substs: ty::substs) {
 
-        debug!{"method_from_class"};
+        debug!{"add_candidates_from_class"};
 
         let ms = *ty::trait_methods(self.tcx(), did);