@@ -33,6 +33,7 @@ use std::ops::Index;
33
33
34
34
use crate :: infer:: MemberConstraint ;
35
35
use crate :: mir:: ConstraintCategory ;
36
+ use crate :: traits:: DefiningAnchor ;
36
37
use crate :: ty:: GenericArg ;
37
38
use crate :: ty:: { self , BoundVar , List , Region , Ty , TyCtxt , TypeFlags , TypeVisitableExt } ;
38
39
@@ -153,11 +154,6 @@ pub struct QueryResponse<'tcx, R> {
153
154
pub var_values : CanonicalVarValues < ' tcx > ,
154
155
pub region_constraints : QueryRegionConstraints < ' tcx > ,
155
156
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.
161
157
pub opaque_types : Vec < ( ty:: OpaqueTypeKey < ' tcx > , Ty < ' tcx > ) > ,
162
158
pub value : R ,
163
159
}
@@ -316,6 +312,7 @@ impl<'tcx> CanonicalParamEnvCache<'tcx> {
316
312
& self ,
317
313
tcx : TyCtxt < ' tcx > ,
318
314
key : ty:: ParamEnv < ' tcx > ,
315
+ defining_anchor : DefiningAnchor < ' tcx > ,
319
316
state : & mut OriginalQueryValues < ' tcx > ,
320
317
canonicalize_op : fn (
321
318
TyCtxt < ' tcx > ,
@@ -330,6 +327,7 @@ impl<'tcx> CanonicalParamEnvCache<'tcx> {
330
327
max_universe : ty:: UniverseIndex :: ROOT ,
331
328
variables : List :: empty ( ) ,
332
329
value : key,
330
+ defining_anchor,
333
331
} ;
334
332
}
335
333
@@ -344,7 +342,8 @@ impl<'tcx> CanonicalParamEnvCache<'tcx> {
344
342
* canonical
345
343
}
346
344
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;
348
347
let OriginalQueryValues { var_values, universe_map } = state;
349
348
assert_eq ! ( universe_map. len( ) , 1 ) ;
350
349
e. insert ( ( canonical, tcx. arena . alloc_slice ( var_values) ) ) ;
0 commit comments