@@ -16,8 +16,8 @@ use crate::infer::nll_relate::{NormalizationStrategy, TypeRelating, TypeRelating
1616use crate :: infer:: region_constraints:: { Constraint , RegionConstraintData } ;
1717use crate :: infer:: { InferCtxt , InferOk , InferResult , NllRegionVariableOrigin } ;
1818use crate :: traits:: query:: { Fallible , NoSolution } ;
19- use crate :: traits:: TraitEngine ;
2019use crate :: traits:: { Obligation , ObligationCause , PredicateObligation } ;
20+ use crate :: traits:: { PredicateObligations , TraitEngine } ;
2121use rustc_data_structures:: captures:: Captures ;
2222use rustc_index:: vec:: Idx ;
2323use rustc_index:: vec:: IndexVec ;
@@ -509,7 +509,7 @@ impl<'tcx> InferCtxt<'tcx> {
509509 for & ( a, b) in & query_response. value . opaque_types {
510510 let a = substitute_value ( self . tcx , & result_subst, a) ;
511511 let b = substitute_value ( self . tcx , & result_subst, b) ;
512- obligations. extend ( self . handle_opaque_type ( a , b , true , cause, param_env) ?. obligations ) ;
512+ obligations. extend ( self . at ( cause, param_env) . eq ( a , b ) ?. obligations ) ;
513513 }
514514
515515 Ok ( InferOk { value : result_subst, obligations } )
@@ -741,17 +741,11 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for QueryTypeRelatingDelegate<'_, 'tcx> {
741741 true
742742 }
743743
744- fn register_opaque_type (
744+ fn register_opaque_type_obligations (
745745 & mut self ,
746- a : Ty < ' tcx > ,
747- b : Ty < ' tcx > ,
748- a_is_expected : bool ,
746+ obligations : PredicateObligations < ' tcx > ,
749747 ) -> Result < ( ) , TypeError < ' tcx > > {
750- self . obligations . extend (
751- self . infcx
752- . handle_opaque_type ( a, b, a_is_expected, & self . cause , self . param_env ) ?
753- . obligations ,
754- ) ;
748+ self . obligations . extend ( obligations) ;
755749 Ok ( ( ) )
756750 }
757751}
0 commit comments