]> git.lizzy.rs Git - rust.git/commitdiff
add some debug! to coercion
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 11 Apr 2017 21:11:41 +0000 (17:11 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 12 Apr 2017 00:32:48 +0000 (20:32 -0400)
src/librustc_typeck/check/coercion.rs

index a5acd0c7e530047368f0d2abdd4ce89e59532ee7..2033eaf886166fc2debabb63dea4d4dc385fd247 100644 (file)
@@ -195,8 +195,10 @@ fn coerce<E>(&self,
         // Consider coercing the subtype to a DST
         let unsize = self.coerce_unsized(a, b);
         if unsize.is_ok() {
+            debug!("coerce: unsize successful");
             return unsize;
         }
+        debug!("coerce: unsize failed");
 
         // Examine the supertype and consider auto-borrowing.
         //
@@ -745,7 +747,7 @@ fn try_find_coercion_lub<E>(&self,
     {
         let prev_ty = self.resolve_type_vars_with_obligations(prev_ty);
         let new_ty = self.resolve_type_vars_with_obligations(new_ty);
-        debug!("coercion::try_find_lub({:?}, {:?})", prev_ty, new_ty);
+        debug!("coercion::try_find_coercion_lub({:?}, {:?})", prev_ty, new_ty);
 
         // Special-ish case: we can coerce any type `T` into the `!`
         // type, but only if the source expression diverges.