@@ -32,7 +32,7 @@ use std::ops::Index;
3232use syntax:: source_map:: Span ;
3333use crate :: ty:: fold:: TypeFoldable ;
3434use crate :: ty:: subst:: GenericArg ;
35- use crate :: ty:: { self , BoundVar , Lift , List , Region , TyCtxt } ;
35+ use crate :: ty:: { self , BoundVar , List , Region , TyCtxt } ;
3636
3737mod canonicalizer;
3838
@@ -44,7 +44,7 @@ mod substitute;
4444/// variables have been rewritten to "canonical vars". These are
4545/// numbered starting from 0 in order of first appearance.
4646#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , RustcDecodable , RustcEncodable ) ]
47- #[ derive( HashStable , TypeFoldable ) ]
47+ #[ derive( HashStable , TypeFoldable , Lift ) ]
4848pub struct Canonical < ' tcx , V > {
4949 pub max_universe : ty:: UniverseIndex ,
5050 pub variables : CanonicalVarInfos < ' tcx > ,
@@ -65,7 +65,7 @@ impl<'tcx> UseSpecializedDecodable for CanonicalVarInfos<'tcx> {}
6565/// variables. You will need to supply it later to instantiate the
6666/// canonicalized query response.
6767#[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcDecodable , RustcEncodable ) ]
68- #[ derive( HashStable , TypeFoldable ) ]
68+ #[ derive( HashStable , TypeFoldable , Lift ) ]
6969pub struct CanonicalVarValues < ' tcx > {
7070 pub var_values : IndexVec < BoundVar , GenericArg < ' tcx > > ,
7171}
@@ -188,15 +188,15 @@ pub enum CanonicalTyVarKind {
188188/// After we execute a query with a canonicalized key, we get back a
189189/// `Canonical<QueryResponse<..>>`. You can use
190190/// `instantiate_query_result` to access the data in this result.
191- #[ derive( Clone , Debug , HashStable , TypeFoldable ) ]
191+ #[ derive( Clone , Debug , HashStable , TypeFoldable , Lift ) ]
192192pub struct QueryResponse < ' tcx , R > {
193193 pub var_values : CanonicalVarValues < ' tcx > ,
194194 pub region_constraints : QueryRegionConstraints < ' tcx > ,
195195 pub certainty : Certainty ,
196196 pub value : R ,
197197}
198198
199- #[ derive( Clone , Debug , Default , HashStable , TypeFoldable ) ]
199+ #[ derive( Clone , Debug , Default , HashStable , TypeFoldable , Lift ) ]
200200pub struct QueryRegionConstraints < ' tcx > {
201201 pub outlives : Vec < QueryOutlivesConstraint < ' tcx > > ,
202202 pub member_constraints : Vec < MemberConstraint < ' tcx > > ,
@@ -469,13 +469,6 @@ CloneTypeFoldableImpls! {
469469 }
470470}
471471
472- BraceStructLiftImpl ! {
473- impl <' a, ' tcx, T > Lift <' tcx> for Canonical <' a, T > {
474- type Lifted = Canonical <' tcx, T :: Lifted >;
475- max_universe, variables, value
476- } where T : Lift <' tcx>
477- }
478-
479472impl < ' tcx > CanonicalVarValues < ' tcx > {
480473 pub fn len ( & self ) -> usize {
481474 self . var_values . len ( )
@@ -521,27 +514,6 @@ impl<'a, 'tcx> IntoIterator for &'a CanonicalVarValues<'tcx> {
521514 }
522515}
523516
524- BraceStructLiftImpl ! {
525- impl <' a, ' tcx> Lift <' tcx> for CanonicalVarValues <' a> {
526- type Lifted = CanonicalVarValues <' tcx>;
527- var_values,
528- }
529- }
530-
531- BraceStructLiftImpl ! {
532- impl <' a, ' tcx, R > Lift <' tcx> for QueryResponse <' a, R > {
533- type Lifted = QueryResponse <' tcx, R :: Lifted >;
534- var_values, region_constraints, certainty, value
535- } where R : Lift <' tcx>
536- }
537-
538- BraceStructLiftImpl ! {
539- impl <' a, ' tcx> Lift <' tcx> for QueryRegionConstraints <' a> {
540- type Lifted = QueryRegionConstraints <' tcx>;
541- outlives, member_constraints
542- }
543- }
544-
545517impl < ' tcx > Index < BoundVar > for CanonicalVarValues < ' tcx > {
546518 type Output = GenericArg < ' tcx > ;
547519
0 commit comments