@@ -737,11 +737,23 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
737
737
ProjectionMismatched ( x) => ProjectionMismatched ( x) ,
738
738
ProjectionBoundsLength ( x) => ProjectionBoundsLength ( x) ,
739
739
Sorts ( ref x) => return tcx. lift ( x) . map ( Sorts ) ,
740
- ExistentialMismatch ( ref x) => return tcx. lift ( x) . map ( ExistentialMismatch )
740
+ ExistentialMismatch ( ref x) => return tcx. lift ( x) . map ( ExistentialMismatch ) ,
741
+ ConstError ( ref x) => return tcx. lift ( x) . map ( ConstError ) ,
741
742
} )
742
743
}
743
744
}
744
745
746
+ impl < ' a , ' tcx > Lift < ' tcx > for ty:: error:: ConstError < ' a > {
747
+ type Lifted = ty:: error:: ConstError < ' tcx > ;
748
+ fn lift_to_tcx < ' b , ' gcx > ( & self , tcx : TyCtxt < ' b , ' gcx , ' tcx > ) -> Option < Self :: Lifted > {
749
+ use ty:: error:: ConstError :: * ;
750
+
751
+ match * self {
752
+ Mismatch ( ref x) => return tcx. lift ( x) . map ( Mismatch ) ,
753
+ }
754
+ }
755
+ }
756
+
745
757
impl < ' a , ' tcx > Lift < ' tcx > for ty:: InstanceDef < ' a > {
746
758
type Lifted = ty:: InstanceDef < ' tcx > ;
747
759
fn lift_to_tcx < ' b , ' gcx > ( & self , tcx : TyCtxt < ' b , ' gcx , ' tcx > ) -> Option < Self :: Lifted > {
@@ -1320,6 +1332,13 @@ EnumTypeFoldableImpl! {
1320
1332
( ty:: error:: TypeError :: ProjectionBoundsLength ) ( x) ,
1321
1333
( ty:: error:: TypeError :: Sorts ) ( x) ,
1322
1334
( ty:: error:: TypeError :: ExistentialMismatch ) ( x) ,
1335
+ ( ty:: error:: TypeError :: ConstError ) ( x) ,
1336
+ }
1337
+ }
1338
+
1339
+ EnumTypeFoldableImpl ! {
1340
+ impl <' tcx> TypeFoldable <' tcx> for ty:: error:: ConstError <' tcx> {
1341
+ ( ty:: error:: ConstError :: Mismatch ) ( x) ,
1323
1342
}
1324
1343
}
1325
1344
0 commit comments