@@ -25,7 +25,7 @@ use rustc_middle::arena::ArenaAllocatable;
25
25
use rustc_middle:: ty:: fold:: TypeFoldable ;
26
26
use rustc_middle:: ty:: relate:: TypeRelation ;
27
27
use rustc_middle:: ty:: subst:: { GenericArg , GenericArgKind } ;
28
- use rustc_middle:: ty:: { self , BoundVar , Const , OpaqueTypeKey , ToPredicate , Ty , TyCtxt } ;
28
+ use rustc_middle:: ty:: { self , BoundVar , Const , ToPredicate , Ty , TyCtxt } ;
29
29
use rustc_span:: Span ;
30
30
use std:: fmt:: Debug ;
31
31
use std:: iter;
@@ -146,13 +146,13 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
146
146
} )
147
147
}
148
148
149
- fn take_opaque_types_for_query_response ( & self ) -> Vec < ( OpaqueTypeKey < ' tcx > , Ty < ' tcx > ) > {
149
+ fn take_opaque_types_for_query_response ( & self ) -> Vec < ( Ty < ' tcx > , Ty < ' tcx > ) > {
150
150
self . inner
151
151
. borrow_mut ( )
152
152
. opaque_type_storage
153
153
. take_opaque_types ( )
154
154
. into_iter ( )
155
- . map ( |( k, v) | ( k , v. hidden_type . ty ) )
155
+ . map ( |( k, v) | ( self . tcx . mk_opaque ( k . def_id , k . substs ) , v. hidden_type . ty ) )
156
156
. collect ( )
157
157
}
158
158
@@ -497,11 +497,10 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
497
497
let mut obligations = vec ! [ ] ;
498
498
499
499
// Carry all newly resolved opaque types to the caller's scope
500
- for & ( key, ty) in & query_response. value . opaque_types {
501
- let substs = substitute_value ( self . tcx , & result_subst, key. substs ) ;
502
- let opaque = self . tcx . mk_opaque ( key. def_id , substs) ;
503
- let ty = substitute_value ( self . tcx , & result_subst, ty) ;
504
- obligations. extend ( self . handle_opaque_type ( opaque, ty, cause, param_env) ?. obligations ) ;
500
+ for & ( a, b) in & query_response. value . opaque_types {
501
+ let a = substitute_value ( self . tcx , & result_subst, a) ;
502
+ let b = substitute_value ( self . tcx , & result_subst, b) ;
503
+ obligations. extend ( self . handle_opaque_type ( a, b, cause, param_env) ?. obligations ) ;
505
504
}
506
505
507
506
Ok ( InferOk { value : result_subst, obligations } )
0 commit comments