@@ -35,7 +35,7 @@ use traits::{FulfillmentContext, TraitEngine};
3535use traits:: { Obligation , ObligationCause , PredicateObligation } ;
3636use ty:: fold:: TypeFoldable ;
3737use ty:: subst:: { Kind , UnpackedKind } ;
38- use ty:: { self , CanonicalVar , Lift , Ty , TyCtxt } ;
38+ use ty:: { self , BoundTyIndex , Lift , Ty , TyCtxt } ;
3939
4040impl < ' cx , ' gcx , ' tcx > InferCtxtBuilder < ' cx , ' gcx , ' tcx > {
4141 /// The "main method" for a canonicalized trait query. Given the
@@ -273,7 +273,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
273273 for ( index, original_value) in original_values. var_values . iter ( ) . enumerate ( ) {
274274 // ...with the value `v_r` of that variable from the query.
275275 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) ]
277277 } ) ;
278278 match ( original_value. unpack ( ) , result_value. unpack ( ) ) {
279279 ( UnpackedKind :: Lifetime ( ty:: ReErased ) , UnpackedKind :: Lifetime ( ty:: ReErased ) ) => {
@@ -408,7 +408,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
408408 // is directly equal to one of the canonical variables in the
409409 // result, then we can type the corresponding value from the
410410 // 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 > > > =
412412 IndexVec :: from_elem_n ( None , query_response. variables . len ( ) ) ;
413413
414414 // In terms of our example above, we are iterating over pairs like:
@@ -440,7 +440,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
440440 . variables
441441 . iter ( )
442442 . 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 ( ||
444444 self . fresh_inference_var_for_canonical_var ( cause. span , * info)
445445 ) )
446446 . collect ( ) ,
@@ -470,7 +470,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
470470 // canonical variable; this is taken from
471471 // `query_response.var_values` after applying the substitution
472472 // `result_subst`.
473- let substituted_query_response = |index : CanonicalVar | -> Kind < ' tcx > {
473+ let substituted_query_response = |index : BoundTyIndex | -> Kind < ' tcx > {
474474 query_response. substitute_projected ( self . tcx , & result_subst, |v| & v. var_values [ index] )
475475 } ;
476476
@@ -526,12 +526,12 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
526526 cause : & ObligationCause < ' tcx > ,
527527 param_env : ty:: ParamEnv < ' tcx > ,
528528 variables1 : & OriginalQueryValues < ' tcx > ,
529- variables2 : impl Fn ( CanonicalVar ) -> Kind < ' tcx > ,
529+ variables2 : impl Fn ( BoundTyIndex ) -> Kind < ' tcx > ,
530530 ) -> InferResult < ' tcx , ( ) > {
531531 self . commit_if_ok ( |_| {
532532 let mut obligations = vec ! [ ] ;
533533 for ( index, value1) in variables1. var_values . iter ( ) . enumerate ( ) {
534- let value2 = variables2 ( CanonicalVar :: new ( index) ) ;
534+ let value2 = variables2 ( BoundTyIndex :: new ( index) ) ;
535535
536536 match ( value1. unpack ( ) , value2. unpack ( ) ) {
537537 ( UnpackedKind :: Type ( v1) , UnpackedKind :: Type ( v2) ) => {
0 commit comments