@@ -35,7 +35,7 @@ use traits::{FulfillmentContext, TraitEngine};
35
35
use traits:: { Obligation , ObligationCause , PredicateObligation } ;
36
36
use ty:: fold:: TypeFoldable ;
37
37
use ty:: subst:: { Kind , UnpackedKind } ;
38
- use ty:: { self , CanonicalVar , Lift , Ty , TyCtxt } ;
38
+ use ty:: { self , BoundTyIndex , Lift , Ty , TyCtxt } ;
39
39
40
40
impl < ' cx , ' gcx , ' tcx > InferCtxtBuilder < ' cx , ' gcx , ' tcx > {
41
41
/// The "main method" for a canonicalized trait query. Given the
@@ -273,7 +273,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
273
273
for ( index, original_value) in original_values. var_values . iter ( ) . enumerate ( ) {
274
274
// ...with the value `v_r` of that variable from the query.
275
275
let result_value = query_response. substitute_projected ( self . tcx , & result_subst, |v| {
276
- & v. var_values [ CanonicalVar :: new ( index) ]
276
+ & v. var_values [ BoundTyIndex :: new ( index) ]
277
277
} ) ;
278
278
match ( original_value. unpack ( ) , result_value. unpack ( ) ) {
279
279
( UnpackedKind :: Lifetime ( ty:: ReErased ) , UnpackedKind :: Lifetime ( ty:: ReErased ) ) => {
@@ -408,7 +408,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
408
408
// is directly equal to one of the canonical variables in the
409
409
// result, then we can type the corresponding value from the
410
410
// input. See the example above.
411
- let mut opt_values: IndexVec < CanonicalVar , Option < Kind < ' tcx > > > =
411
+ let mut opt_values: IndexVec < BoundTyIndex , Option < Kind < ' tcx > > > =
412
412
IndexVec :: from_elem_n ( None , query_response. variables . len ( ) ) ;
413
413
414
414
// In terms of our example above, we are iterating over pairs like:
@@ -440,7 +440,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
440
440
. variables
441
441
. iter ( )
442
442
. enumerate ( )
443
- . map ( |( index, info) | opt_values[ CanonicalVar :: new ( index) ] . unwrap_or_else ( ||
443
+ . map ( |( index, info) | opt_values[ BoundTyIndex :: new ( index) ] . unwrap_or_else ( ||
444
444
self . fresh_inference_var_for_canonical_var ( cause. span , * info)
445
445
) )
446
446
. collect ( ) ,
@@ -470,7 +470,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
470
470
// canonical variable; this is taken from
471
471
// `query_response.var_values` after applying the substitution
472
472
// `result_subst`.
473
- let substituted_query_response = |index : CanonicalVar | -> Kind < ' tcx > {
473
+ let substituted_query_response = |index : BoundTyIndex | -> Kind < ' tcx > {
474
474
query_response. substitute_projected ( self . tcx , & result_subst, |v| & v. var_values [ index] )
475
475
} ;
476
476
@@ -526,12 +526,12 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
526
526
cause : & ObligationCause < ' tcx > ,
527
527
param_env : ty:: ParamEnv < ' tcx > ,
528
528
variables1 : & OriginalQueryValues < ' tcx > ,
529
- variables2 : impl Fn ( CanonicalVar ) -> Kind < ' tcx > ,
529
+ variables2 : impl Fn ( BoundTyIndex ) -> Kind < ' tcx > ,
530
530
) -> InferResult < ' tcx , ( ) > {
531
531
self . commit_if_ok ( |_| {
532
532
let mut obligations = vec ! [ ] ;
533
533
for ( index, value1) in variables1. var_values . iter ( ) . enumerate ( ) {
534
- let value2 = variables2 ( CanonicalVar :: new ( index) ) ;
534
+ let value2 = variables2 ( BoundTyIndex :: new ( index) ) ;
535
535
536
536
match ( value1. unpack ( ) , value2. unpack ( ) ) {
537
537
( UnpackedKind :: Type ( v1) , UnpackedKind :: Type ( v2) ) => {
0 commit comments