@@ -153,13 +153,22 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
153
153
) -> QueryResult < ' tcx > {
154
154
let tcx = self . tcx ( ) ;
155
155
// We may need to invert the alias relation direction if dealing an alias on the RHS.
156
+ #[ derive( Debug ) ]
156
157
enum Invert {
157
158
No ,
158
159
Yes ,
159
160
}
160
161
let evaluate_normalizes_to =
161
162
|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 ( ) ;
163
172
let result = ecx. probe ( |ecx| {
164
173
let other = match direction {
165
174
// This is purely an optimization.
@@ -184,7 +193,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
184
193
) ) ;
185
194
ecx. evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes )
186
195
} ) ;
187
- debug ! ( "evaluate_normalizes_to({alias}, {other}, {direction:?}) -> { result:?}" ) ;
196
+ debug ! ( ? result) ;
188
197
result
189
198
} ;
190
199
@@ -210,7 +219,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
210
219
}
211
220
212
221
( Some ( alias_lhs) , Some ( alias_rhs) ) => {
213
- debug ! ( "compute_alias_relate_goal: both sides are aliases" ) ;
222
+ debug ! ( "both sides are aliases" ) ;
214
223
215
224
let candidates = vec ! [
216
225
// LHS normalizes-to RHS
@@ -219,9 +228,14 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
219
228
evaluate_normalizes_to( self , alias_rhs, lhs, direction, Invert :: Yes ) ,
220
229
// Relate via substs
221
230
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
224
237
) ;
238
+ let _enter = span. enter( ) ;
225
239
226
240
match direction {
227
241
ty:: AliasRelationDirection :: Equate => {
@@ -275,6 +289,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
275
289
debug ! ( "added_goals={:?}" , & self . nested_goals. goals[ current_len..] ) ;
276
290
}
277
291
292
+ #[ instrument( level = "debug" , skip( self , responses) ) ]
278
293
fn try_merge_responses (
279
294
& mut self ,
280
295
responses : impl Iterator < Item = QueryResult < ' tcx > > ,
@@ -304,6 +319,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
304
319
} ) ;
305
320
// FIXME(-Ztrait-solver=next): We should take the intersection of the constraints on all the
306
321
// responses and use that for the constraints of this ambiguous response.
322
+ debug ! ( ">1 response, bailing with {certainty:?}" ) ;
307
323
let response = self . evaluate_added_goals_and_make_canonical_response ( certainty) ;
308
324
if let Ok ( response) = & response {
309
325
assert ! ( response. has_no_inference_or_external_constraints( ) ) ;
0 commit comments