@@ -153,13 +153,22 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
153153 ) -> QueryResult < ' tcx > {
154154 let tcx = self . tcx ( ) ;
155155 // We may need to invert the alias relation direction if dealing an alias on the RHS.
156+ #[ derive( Debug ) ]
156157 enum Invert {
157158 No ,
158159 Yes ,
159160 }
160161 let evaluate_normalizes_to =
161162 |ecx : & mut EvalCtxt < ' _ , ' tcx > , alias, other, direction, invert| {
162- debug ! ( "evaluate_normalizes_to(alias={:?}, other={:?})" , alias, other) ;
163+ let span = tracing:: span!(
164+ tracing:: Level :: DEBUG ,
165+ "compute_alias_relate_goal(evaluate_normalizes_to)" ,
166+ ?alias,
167+ ?other,
168+ ?direction,
169+ ?invert
170+ ) ;
171+ let _enter = span. enter ( ) ;
163172 let result = ecx. probe ( |ecx| {
164173 let other = match direction {
165174 // This is purely an optimization.
@@ -184,7 +193,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
184193 ) ) ;
185194 ecx. evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes )
186195 } ) ;
187- debug ! ( "evaluate_normalizes_to({alias}, {other}, {direction:?}) -> { result:?}" ) ;
196+ debug ! ( ? result) ;
188197 result
189198 } ;
190199
@@ -210,7 +219,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
210219 }
211220
212221 ( Some ( alias_lhs) , Some ( alias_rhs) ) => {
213- debug ! ( "compute_alias_relate_goal: both sides are aliases" ) ;
222+ debug ! ( "both sides are aliases" ) ;
214223
215224 let candidates = vec ! [
216225 // LHS normalizes-to RHS
@@ -219,9 +228,14 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
219228 evaluate_normalizes_to( self , alias_rhs, lhs, direction, Invert :: Yes ) ,
220229 // Relate via substs
221230 self . probe( |ecx| {
222- debug!(
223- "compute_alias_relate_goal: alias defids are equal, equating substs"
231+ let span = tracing:: span!(
232+ tracing:: Level :: DEBUG ,
233+ "compute_alias_relate_goal(relate_via_substs)" ,
234+ ?alias_lhs,
235+ ?alias_rhs,
236+ ?direction
224237 ) ;
238+ let _enter = span. enter( ) ;
225239
226240 match direction {
227241 ty:: AliasRelationDirection :: Equate => {
@@ -275,6 +289,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
275289 debug ! ( "added_goals={:?}" , & self . nested_goals. goals[ current_len..] ) ;
276290 }
277291
292+ #[ instrument( level = "debug" , skip( self , responses) ) ]
278293 fn try_merge_responses (
279294 & mut self ,
280295 responses : impl Iterator < Item = QueryResult < ' tcx > > ,
@@ -304,6 +319,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
304319 } ) ;
305320 // FIXME(-Ztrait-solver=next): We should take the intersection of the constraints on all the
306321 // responses and use that for the constraints of this ambiguous response.
322+ debug ! ( ">1 response, bailing with {certainty:?}" ) ;
307323 let response = self . evaluate_added_goals_and_make_canonical_response ( certainty) ;
308324 if let Ok ( response) = & response {
309325 assert ! ( response. has_no_inference_or_external_constraints( ) ) ;
0 commit comments