@@ -393,6 +393,7 @@ impl<'tcx> InferCtxt<'tcx> {
393
393
/// will instantiate fresh inference variables for each canonical
394
394
/// variable instead. Therefore, the result of this method must be
395
395
/// properly unified
396
+ #[ instrument( level = "debug" , skip( self , cause, param_env) ) ]
396
397
fn query_response_substitution_guess < R > (
397
398
& self ,
398
399
cause : & ObligationCause < ' tcx > ,
@@ -403,11 +404,6 @@ impl<'tcx> InferCtxt<'tcx> {
403
404
where
404
405
R : Debug + TypeFoldable < ' tcx > ,
405
406
{
406
- debug ! (
407
- "query_response_substitution_guess(original_values={:#?}, query_response={:#?})" ,
408
- original_values, query_response,
409
- ) ;
410
-
411
407
// For each new universe created in the query result that did
412
408
// not appear in the original query, create a local
413
409
// superuniverse.
@@ -502,7 +498,9 @@ impl<'tcx> InferCtxt<'tcx> {
502
498
for & ( a, b) in & query_response. value . opaque_types {
503
499
let a = substitute_value ( self . tcx , & result_subst, a) ;
504
500
let b = substitute_value ( self . tcx , & result_subst, b) ;
505
- obligations. extend ( self . at ( cause, param_env) . eq ( a, b) ?. obligations ) ;
501
+ debug ! ( ?a, ?b, "constrain opaque type" ) ;
502
+ obligations
503
+ . extend ( self . at ( cause, param_env) . define_opaque_types ( true ) . eq ( a, b) ?. obligations ) ;
506
504
}
507
505
508
506
Ok ( InferOk { value : result_subst, obligations } )
0 commit comments