@@ -16,7 +16,6 @@ use crate::solve::{
1616use rustc_data_structures:: fx:: FxHashSet ;
1717use rustc_index:: IndexVec ;
1818use rustc_infer:: infer:: canonical:: query_response:: make_query_region_constraints;
19- use rustc_infer:: infer:: canonical:: CanonicalVarValues ;
2019use rustc_infer:: infer:: canonical:: { CanonicalExt , QueryRegionConstraints } ;
2120use rustc_infer:: infer:: RegionVariableOrigin ;
2221use rustc_infer:: infer:: { InferCtxt , InferOk } ;
@@ -32,22 +31,24 @@ use rustc_middle::ty::{self, BoundVar, GenericArgKind, Ty, TyCtxt, TypeFoldable}
3231use rustc_next_trait_solver:: canonicalizer:: { CanonicalizeMode , Canonicalizer } ;
3332use rustc_next_trait_solver:: resolve:: EagerResolver ;
3433use rustc_span:: { Span , DUMMY_SP } ;
34+ use rustc_type_ir:: CanonicalVarValues ;
35+ use rustc_type_ir:: { InferCtxtLike , Interner } ;
3536use std:: assert_matches:: assert_matches;
3637use std:: iter;
3738use std:: ops:: Deref ;
3839
3940trait ResponseT < ' tcx > {
40- fn var_values ( & self ) -> CanonicalVarValues < ' tcx > ;
41+ fn var_values ( & self ) -> CanonicalVarValues < TyCtxt < ' tcx > > ;
4142}
4243
4344impl < ' tcx > ResponseT < ' tcx > for Response < TyCtxt < ' tcx > > {
44- fn var_values ( & self ) -> CanonicalVarValues < ' tcx > {
45+ fn var_values ( & self ) -> CanonicalVarValues < TyCtxt < ' tcx > > {
4546 self . var_values
4647 }
4748}
4849
4950impl < ' 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 > > {
5152 self . var_values
5253 }
5354}
@@ -246,7 +247,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
246247 infcx : & InferCtxt < ' tcx > ,
247248 original_values : & [ ty:: GenericArg < ' tcx > ] ,
248249 response : & Canonical < ' tcx , T > ,
249- ) -> CanonicalVarValues < ' tcx > {
250+ ) -> CanonicalVarValues < TyCtxt < ' tcx > > {
250251 // FIXME: Longterm canonical queries should deal with all placeholders
251252 // created inside of the query directly instead of returning them to the
252253 // caller.
@@ -340,7 +341,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
340341 infcx : & InferCtxt < ' tcx > ,
341342 param_env : ty:: ParamEnv < ' tcx > ,
342343 original_values : & [ ty:: GenericArg < ' tcx > ] ,
343- var_values : CanonicalVarValues < ' tcx > ,
344+ var_values : CanonicalVarValues < TyCtxt < ' tcx > > ,
344345 ) {
345346 assert_eq ! ( original_values. len( ) , var_values. len( ) ) ;
346347
@@ -379,13 +380,17 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
379380/// evaluating a goal. The `var_values` not only include the bound variables
380381/// of the query input, but also contain all unconstrained inference vars
381382/// 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 ] ,
385390 max_input_universe : ty:: UniverseIndex ,
386391 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) } ;
389394 let state = inspect:: State { var_values, data } ;
390395 let state = state. fold_with ( & mut EagerResolver :: new ( infcx) ) ;
391396 Canonicalizer :: canonicalize (
0 commit comments