@@ -867,6 +867,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
867
867
/// Compares two given types, eliding parts that are the same between them and highlighting
868
868
/// relevant differences, and return two representation of those types for highlighted printing.
869
869
fn cmp ( & self , t1 : Ty < ' tcx > , t2 : Ty < ' tcx > ) -> ( DiagnosticStyledString , DiagnosticStyledString ) {
870
+ debug ! ( "cmp(t1={}, t2={})" , t1, t2) ;
871
+
872
+ // helper functions
870
873
fn equals < ' tcx > ( a : Ty < ' tcx > , b : Ty < ' tcx > ) -> bool {
871
874
match ( & a. kind , & b. kind ) {
872
875
( a, b) if * a == * b => true ,
@@ -902,6 +905,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
902
905
s. push_normal ( ty. to_string ( ) ) ;
903
906
}
904
907
908
+ // process starts here
905
909
match ( & t1. kind , & t2. kind ) {
906
910
( & ty:: Adt ( def1, sub1) , & ty:: Adt ( def2, sub2) ) => {
907
911
let sub_no_defaults_1 = self . strip_generic_default_params ( def1. did , sub1) ;
@@ -1120,6 +1124,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1120
1124
_ => { }
1121
1125
}
1122
1126
1127
+ debug ! ( "note_type_err(diag={:?})" , diag) ;
1123
1128
let ( expected_found, exp_found, is_simple_error) = match values {
1124
1129
None => ( None , None , false ) ,
1125
1130
Some ( values) => {
@@ -1170,6 +1175,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
1170
1175
) ;
1171
1176
}
1172
1177
( _, false , _) => {
1178
+ debug ! (
1179
+ "note_type_err: exp_found={:?}, expected={:?} found={:?}" ,
1180
+ exp_found, expected, found
1181
+ ) ;
1173
1182
if let Some ( exp_found) = exp_found {
1174
1183
self . suggest_as_ref_where_appropriate ( span, & exp_found, diag) ;
1175
1184
}
0 commit comments