@@ -16,7 +16,6 @@ use crate::solve::{
16
16
use rustc_data_structures:: fx:: FxHashSet ;
17
17
use rustc_index:: IndexVec ;
18
18
use rustc_infer:: infer:: canonical:: query_response:: make_query_region_constraints;
19
- use rustc_infer:: infer:: canonical:: CanonicalVarValues ;
20
19
use rustc_infer:: infer:: canonical:: { CanonicalExt , QueryRegionConstraints } ;
21
20
use rustc_infer:: infer:: RegionVariableOrigin ;
22
21
use rustc_infer:: infer:: { InferCtxt , InferOk } ;
@@ -32,22 +31,24 @@ use rustc_middle::ty::{self, BoundVar, GenericArgKind, Ty, TyCtxt, TypeFoldable}
32
31
use rustc_next_trait_solver:: canonicalizer:: { CanonicalizeMode , Canonicalizer } ;
33
32
use rustc_next_trait_solver:: resolve:: EagerResolver ;
34
33
use rustc_span:: { Span , DUMMY_SP } ;
34
+ use rustc_type_ir:: CanonicalVarValues ;
35
+ use rustc_type_ir:: { InferCtxtLike , Interner } ;
35
36
use std:: assert_matches:: assert_matches;
36
37
use std:: iter;
37
38
use std:: ops:: Deref ;
38
39
39
40
trait ResponseT < ' tcx > {
40
- fn var_values ( & self ) -> CanonicalVarValues < ' tcx > ;
41
+ fn var_values ( & self ) -> CanonicalVarValues < TyCtxt < ' tcx > > ;
41
42
}
42
43
43
44
impl < ' tcx > ResponseT < ' tcx > for Response < TyCtxt < ' tcx > > {
44
- fn var_values ( & self ) -> CanonicalVarValues < ' tcx > {
45
+ fn var_values ( & self ) -> CanonicalVarValues < TyCtxt < ' tcx > > {
45
46
self . var_values
46
47
}
47
48
}
48
49
49
50
impl < ' tcx , T > ResponseT < ' tcx > for inspect:: State < TyCtxt < ' tcx > , T > {
50
- fn var_values ( & self ) -> CanonicalVarValues < ' tcx > {
51
+ fn var_values ( & self ) -> CanonicalVarValues < TyCtxt < ' tcx > > {
51
52
self . var_values
52
53
}
53
54
}
@@ -246,7 +247,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
246
247
infcx : & InferCtxt < ' tcx > ,
247
248
original_values : & [ ty:: GenericArg < ' tcx > ] ,
248
249
response : & Canonical < ' tcx , T > ,
249
- ) -> CanonicalVarValues < ' tcx > {
250
+ ) -> CanonicalVarValues < TyCtxt < ' tcx > > {
250
251
// FIXME: Longterm canonical queries should deal with all placeholders
251
252
// created inside of the query directly instead of returning them to the
252
253
// caller.
@@ -340,7 +341,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
340
341
infcx : & InferCtxt < ' tcx > ,
341
342
param_env : ty:: ParamEnv < ' tcx > ,
342
343
original_values : & [ ty:: GenericArg < ' tcx > ] ,
343
- var_values : CanonicalVarValues < ' tcx > ,
344
+ var_values : CanonicalVarValues < TyCtxt < ' tcx > > ,
344
345
) {
345
346
assert_eq ! ( original_values. len( ) , var_values. len( ) ) ;
346
347
@@ -379,13 +380,17 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
379
380
/// evaluating a goal. The `var_values` not only include the bound variables
380
381
/// of the query input, but also contain all unconstrained inference vars
381
382
/// created while evaluating this goal.
382
- pub ( in crate :: solve) fn make_canonical_state < ' tcx , T : TypeFoldable < TyCtxt < ' tcx > > > (
383
- infcx : & InferCtxt < ' tcx > ,
384
- var_values : & [ ty:: GenericArg < ' tcx > ] ,
383
+ pub ( in crate :: solve) fn make_canonical_state <
384
+ Infcx : InferCtxtLike < Interner = I > ,
385
+ I : Interner ,
386
+ T : TypeFoldable < I > ,
387
+ > (
388
+ infcx : & Infcx ,
389
+ var_values : & [ I :: GenericArg ] ,
385
390
max_input_universe : ty:: UniverseIndex ,
386
391
data : T ,
387
- ) -> inspect:: CanonicalState < TyCtxt < ' tcx > , T > {
388
- let var_values = CanonicalVarValues { var_values : infcx. tcx . mk_args ( var_values) } ;
392
+ ) -> inspect:: CanonicalState < I , T > {
393
+ let var_values = CanonicalVarValues { var_values : infcx. interner ( ) . mk_args ( var_values) } ;
389
394
let state = inspect:: State { var_values, data } ;
390
395
let state = state. fold_with ( & mut EagerResolver :: new ( infcx) ) ;
391
396
Canonicalizer :: canonicalize (
0 commit comments