@@ -65,6 +65,8 @@ impl Graph {
65
65
let trait_ref = tcx. impl_trait_ref ( impl_def_id) . unwrap ( ) ;
66
66
let trait_def_id = trait_ref. def_id ;
67
67
68
+ debug ! ( "inserting TraitRef {:?} into specialization graph" , trait_ref) ;
69
+
68
70
// if the reference itself contains an earlier error (e.g., due to a
69
71
// resolution failure), then we just insert the impl at the top level of
70
72
// the graph and claim that there's no overlap (in order to supress
@@ -99,10 +101,16 @@ impl Graph {
99
101
let ge = specializes ( tcx, possible_sibling, impl_def_id) ;
100
102
101
103
if le && !ge {
104
+ let parent_trait_ref = tcx. impl_trait_ref ( possible_sibling) . unwrap ( ) ;
105
+ debug ! ( "descending as child of TraitRef {:?}" , parent_trait_ref) ;
106
+
102
107
// the impl specializes possible_sibling
103
108
parent = possible_sibling;
104
109
continue ' descend;
105
110
} else if ge && !le {
111
+ let child_trait_ref = tcx. impl_trait_ref ( possible_sibling) . unwrap ( ) ;
112
+ debug ! ( "placing as parent of TraitRef {:?}" , child_trait_ref) ;
113
+
106
114
// possible_sibling specializes the impl
107
115
* slot = impl_def_id;
108
116
self . parent . insert ( impl_def_id, parent) ;
@@ -123,6 +131,7 @@ impl Graph {
123
131
}
124
132
125
133
// no overlap with any potential siblings, so add as a new sibling
134
+ debug ! ( "placing as new sibling" ) ;
126
135
self . parent . insert ( impl_def_id, parent) ;
127
136
possible_siblings. push ( impl_def_id) ;
128
137
return Ok ( ( ) ) ;
0 commit comments