@@ -43,7 +43,8 @@ mod substitute;
43
43
/// A "canonicalized" type `V` is one where all free inference
44
44
/// variables have been rewritten to "canonical vars". These are
45
45
/// numbered starting from 0 in order of first appearance.
46
- #[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , RustcDecodable , RustcEncodable , HashStable ) ]
46
+ #[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , RustcDecodable , RustcEncodable ) ]
47
+ #[ derive( HashStable , TypeFoldable ) ]
47
48
pub struct Canonical < ' tcx , V > {
48
49
pub max_universe : ty:: UniverseIndex ,
49
50
pub variables : CanonicalVarInfos < ' tcx > ,
@@ -63,7 +64,8 @@ impl<'tcx> UseSpecializedDecodable for CanonicalVarInfos<'tcx> {}
63
64
/// vectors with the original values that were replaced by canonical
64
65
/// variables. You will need to supply it later to instantiate the
65
66
/// canonicalized query response.
66
- #[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcDecodable , RustcEncodable , HashStable ) ]
67
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , RustcDecodable , RustcEncodable ) ]
68
+ #[ derive( HashStable , TypeFoldable ) ]
67
69
pub struct CanonicalVarValues < ' tcx > {
68
70
pub var_values : IndexVec < BoundVar , GenericArg < ' tcx > > ,
69
71
}
@@ -186,15 +188,15 @@ pub enum CanonicalTyVarKind {
186
188
/// After we execute a query with a canonicalized key, we get back a
187
189
/// `Canonical<QueryResponse<..>>`. You can use
188
190
/// `instantiate_query_result` to access the data in this result.
189
- #[ derive( Clone , Debug , HashStable ) ]
191
+ #[ derive( Clone , Debug , HashStable , TypeFoldable ) ]
190
192
pub struct QueryResponse < ' tcx , R > {
191
193
pub var_values : CanonicalVarValues < ' tcx > ,
192
194
pub region_constraints : QueryRegionConstraints < ' tcx > ,
193
195
pub certainty : Certainty ,
194
196
pub value : R ,
195
197
}
196
198
197
- #[ derive( Clone , Debug , Default , HashStable ) ]
199
+ #[ derive( Clone , Debug , Default , HashStable , TypeFoldable ) ]
198
200
pub struct QueryRegionConstraints < ' tcx > {
199
201
pub outlives : Vec < QueryOutlivesConstraint < ' tcx > > ,
200
202
pub member_constraints : Vec < MemberConstraint < ' tcx > > ,
@@ -467,14 +469,6 @@ CloneTypeFoldableImpls! {
467
469
}
468
470
}
469
471
470
- BraceStructTypeFoldableImpl ! {
471
- impl <' tcx, C > TypeFoldable <' tcx> for Canonical <' tcx, C > {
472
- max_universe,
473
- variables,
474
- value,
475
- } where C : TypeFoldable <' tcx>
476
- }
477
-
478
472
BraceStructLiftImpl ! {
479
473
impl <' a, ' tcx, T > Lift <' tcx> for Canonical <' a, T > {
480
474
type Lifted = Canonical <' tcx, T :: Lifted >;
@@ -534,31 +528,13 @@ BraceStructLiftImpl! {
534
528
}
535
529
}
536
530
537
- BraceStructTypeFoldableImpl ! {
538
- impl <' tcx> TypeFoldable <' tcx> for CanonicalVarValues <' tcx> {
539
- var_values,
540
- }
541
- }
542
-
543
- BraceStructTypeFoldableImpl ! {
544
- impl <' tcx, R > TypeFoldable <' tcx> for QueryResponse <' tcx, R > {
545
- var_values, region_constraints, certainty, value
546
- } where R : TypeFoldable <' tcx>,
547
- }
548
-
549
531
BraceStructLiftImpl ! {
550
532
impl <' a, ' tcx, R > Lift <' tcx> for QueryResponse <' a, R > {
551
533
type Lifted = QueryResponse <' tcx, R :: Lifted >;
552
534
var_values, region_constraints, certainty, value
553
535
} where R : Lift <' tcx>
554
536
}
555
537
556
- BraceStructTypeFoldableImpl ! {
557
- impl <' tcx> TypeFoldable <' tcx> for QueryRegionConstraints <' tcx> {
558
- outlives, member_constraints
559
- }
560
- }
561
-
562
538
BraceStructLiftImpl ! {
563
539
impl <' a, ' tcx> Lift <' tcx> for QueryRegionConstraints <' a> {
564
540
type Lifted = QueryRegionConstraints <' tcx>;
0 commit comments