@@ -867,6 +867,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
867867 /// Compares two given types, eliding parts that are the same between them and highlighting
868868 /// relevant differences, and return two representation of those types for highlighted printing.
869869 fn cmp ( & self , t1 : Ty < ' tcx > , t2 : Ty < ' tcx > ) -> ( DiagnosticStyledString , DiagnosticStyledString ) {
870+ debug ! ( "cmp(t1={}, t2={})" , t1, t2) ;
871+
872+ // helper functions
870873 fn equals < ' tcx > ( a : Ty < ' tcx > , b : Ty < ' tcx > ) -> bool {
871874 match ( & a. kind , & b. kind ) {
872875 ( a, b) if * a == * b => true ,
@@ -902,6 +905,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
902905 s. push_normal ( ty. to_string ( ) ) ;
903906 }
904907
908+ // process starts here
905909 match ( & t1. kind , & t2. kind ) {
906910 ( & ty:: Adt ( def1, sub1) , & ty:: Adt ( def2, sub2) ) => {
907911 let sub_no_defaults_1 = self . strip_generic_default_params ( def1. did , sub1) ;
@@ -1120,6 +1124,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11201124 _ => { }
11211125 }
11221126
1127+ debug ! ( "note_type_err(diag={:?})" , diag) ;
11231128 let ( expected_found, exp_found, is_simple_error) = match values {
11241129 None => ( None , None , false ) ,
11251130 Some ( values) => {
@@ -1170,6 +1175,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11701175 ) ;
11711176 }
11721177 ( _, false , _) => {
1178+ debug ! (
1179+ "note_type_err: exp_found={:?}, expected={:?} found={:?}" ,
1180+ exp_found, expected, found
1181+ ) ;
11731182 if let Some ( exp_found) = exp_found {
11741183 self . suggest_as_ref_where_appropriate ( span, & exp_found, diag) ;
11751184 }
0 commit comments