@@ -33,6 +33,7 @@ use std::ops::Index;
3333
3434use crate :: infer:: MemberConstraint ;
3535use crate :: mir:: ConstraintCategory ;
36+ use crate :: traits:: DefiningAnchor ;
3637use crate :: ty:: GenericArg ;
3738use crate :: ty:: { self , BoundVar , List , Region , Ty , TyCtxt , TypeFlags , TypeVisitableExt } ;
3839
@@ -153,11 +154,6 @@ pub struct QueryResponse<'tcx, R> {
153154 pub var_values : CanonicalVarValues < ' tcx > ,
154155 pub region_constraints : QueryRegionConstraints < ' tcx > ,
155156 pub certainty : Certainty ,
156- /// List of opaque types which we tried to compare to another type.
157- /// Inside the query we don't know yet whether the opaque type actually
158- /// should get its hidden type inferred. So we bubble the opaque type
159- /// and the type it was compared against upwards and let the query caller
160- /// handle it.
161157 pub opaque_types : Vec < ( ty:: OpaqueTypeKey < ' tcx > , Ty < ' tcx > ) > ,
162158 pub value : R ,
163159}
@@ -316,6 +312,7 @@ impl<'tcx> CanonicalParamEnvCache<'tcx> {
316312 & self ,
317313 tcx : TyCtxt < ' tcx > ,
318314 key : ty:: ParamEnv < ' tcx > ,
315+ defining_anchor : DefiningAnchor < ' tcx > ,
319316 state : & mut OriginalQueryValues < ' tcx > ,
320317 canonicalize_op : fn (
321318 TyCtxt < ' tcx > ,
@@ -330,6 +327,7 @@ impl<'tcx> CanonicalParamEnvCache<'tcx> {
330327 max_universe : ty:: UniverseIndex :: ROOT ,
331328 variables : List :: empty ( ) ,
332329 value : key,
330+ defining_anchor,
333331 } ;
334332 }
335333
@@ -344,7 +342,8 @@ impl<'tcx> CanonicalParamEnvCache<'tcx> {
344342 * canonical
345343 }
346344 Entry :: Vacant ( e) => {
347- let canonical = canonicalize_op ( tcx, key, state) ;
345+ let mut canonical = canonicalize_op ( tcx, key, state) ;
346+ canonical. defining_anchor = defining_anchor;
348347 let OriginalQueryValues { var_values, universe_map } = state;
349348 assert_eq ! ( universe_map. len( ) , 1 ) ;
350349 e. insert ( ( canonical, tcx. arena . alloc_slice ( var_values) ) ) ;
0 commit comments