@@ -232,6 +232,7 @@ TrivialLiftImpls! {
232
232
crate :: mir:: Promoted ,
233
233
crate :: mir:: interpret:: AllocId ,
234
234
crate :: mir:: interpret:: Scalar ,
235
+ crate :: ty:: ParamConst ,
235
236
rustc_abi:: ExternAbi ,
236
237
rustc_abi:: Size ,
237
238
rustc_hir:: Safety ,
@@ -271,10 +272,6 @@ TrivialTypeTraversalImpls! {
271
272
crate :: ty:: AssocItem ,
272
273
crate :: ty:: AssocKind ,
273
274
crate :: ty:: BoundRegion ,
274
- crate :: ty:: BoundVar ,
275
- crate :: ty:: InferConst ,
276
- crate :: ty:: Placeholder <crate :: ty:: BoundRegion >,
277
- crate :: ty:: Placeholder <ty:: BoundVar >,
278
275
crate :: ty:: UserTypeAnnotationIndex ,
279
276
crate :: ty:: ValTree <' tcx>,
280
277
crate :: ty:: abstract_const:: NotConstEvaluatable ,
@@ -302,9 +299,8 @@ TrivialTypeTraversalImpls! {
302
299
// interners).
303
300
TrivialTypeTraversalAndLiftImpls ! {
304
301
// tidy-alphabetical-start
305
- crate :: ty:: ParamConst ,
306
302
crate :: ty:: ParamTy ,
307
- crate :: ty:: Placeholder < crate :: ty :: BoundTy > ,
303
+ crate :: ty:: PlaceholderType ,
308
304
crate :: ty:: instance:: ReifyReason ,
309
305
rustc_hir:: def_id:: DefId ,
310
306
// tidy-alphabetical-end
@@ -673,30 +669,30 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Const<'tcx> {
673
669
folder : & mut F ,
674
670
) -> Result < Self , F :: Error > {
675
671
let kind = match self . kind ( ) {
676
- ConstKind :: Param ( p) => ConstKind :: Param ( p. try_fold_with ( folder) ?) ,
677
- ConstKind :: Infer ( i) => ConstKind :: Infer ( i. try_fold_with ( folder) ?) ,
678
- ConstKind :: Bound ( d, b) => {
679
- ConstKind :: Bound ( d. try_fold_with ( folder) ?, b. try_fold_with ( folder) ?)
680
- }
681
- ConstKind :: Placeholder ( p) => ConstKind :: Placeholder ( p. try_fold_with ( folder) ?) ,
682
672
ConstKind :: Unevaluated ( uv) => ConstKind :: Unevaluated ( uv. try_fold_with ( folder) ?) ,
683
673
ConstKind :: Value ( v) => ConstKind :: Value ( v. try_fold_with ( folder) ?) ,
684
- ConstKind :: Error ( e) => ConstKind :: Error ( e. try_fold_with ( folder) ?) ,
685
674
ConstKind :: Expr ( e) => ConstKind :: Expr ( e. try_fold_with ( folder) ?) ,
675
+
676
+ ConstKind :: Param ( _)
677
+ | ConstKind :: Infer ( _)
678
+ | ConstKind :: Bound ( ..)
679
+ | ConstKind :: Placeholder ( _)
680
+ | ConstKind :: Error ( _) => return Ok ( self ) ,
686
681
} ;
687
682
if kind != self . kind ( ) { Ok ( folder. cx ( ) . mk_ct_from_kind ( kind) ) } else { Ok ( self ) }
688
683
}
689
684
690
685
fn super_fold_with < F : TypeFolder < TyCtxt < ' tcx > > > ( self , folder : & mut F ) -> Self {
691
686
let kind = match self . kind ( ) {
692
- ConstKind :: Param ( p) => ConstKind :: Param ( p. fold_with ( folder) ) ,
693
- ConstKind :: Infer ( i) => ConstKind :: Infer ( i. fold_with ( folder) ) ,
694
- ConstKind :: Bound ( d, b) => ConstKind :: Bound ( d. fold_with ( folder) , b. fold_with ( folder) ) ,
695
- ConstKind :: Placeholder ( p) => ConstKind :: Placeholder ( p. fold_with ( folder) ) ,
696
687
ConstKind :: Unevaluated ( uv) => ConstKind :: Unevaluated ( uv. fold_with ( folder) ) ,
697
688
ConstKind :: Value ( v) => ConstKind :: Value ( v. fold_with ( folder) ) ,
698
- ConstKind :: Error ( e) => ConstKind :: Error ( e. fold_with ( folder) ) ,
699
689
ConstKind :: Expr ( e) => ConstKind :: Expr ( e. fold_with ( folder) ) ,
690
+
691
+ ConstKind :: Param ( _)
692
+ | ConstKind :: Infer ( _)
693
+ | ConstKind :: Bound ( ..)
694
+ | ConstKind :: Placeholder ( _)
695
+ | ConstKind :: Error ( _) => return self ,
700
696
} ;
701
697
if kind != self . kind ( ) { folder. cx ( ) . mk_ct_from_kind ( kind) } else { self }
702
698
}
@@ -705,17 +701,15 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Const<'tcx> {
705
701
impl < ' tcx > TypeSuperVisitable < TyCtxt < ' tcx > > for ty:: Const < ' tcx > {
706
702
fn super_visit_with < V : TypeVisitor < TyCtxt < ' tcx > > > ( & self , visitor : & mut V ) -> V :: Result {
707
703
match self . kind ( ) {
708
- ConstKind :: Param ( p) => p. visit_with ( visitor) ,
709
- ConstKind :: Infer ( i) => i. visit_with ( visitor) ,
710
- ConstKind :: Bound ( d, b) => {
711
- try_visit ! ( d. visit_with( visitor) ) ;
712
- b. visit_with ( visitor)
713
- }
714
- ConstKind :: Placeholder ( p) => p. visit_with ( visitor) ,
715
704
ConstKind :: Unevaluated ( uv) => uv. visit_with ( visitor) ,
716
705
ConstKind :: Value ( v) => v. visit_with ( visitor) ,
717
- ConstKind :: Error ( e) => e. visit_with ( visitor) ,
718
706
ConstKind :: Expr ( e) => e. visit_with ( visitor) ,
707
+ ConstKind :: Error ( e) => e. visit_with ( visitor) ,
708
+
709
+ ConstKind :: Param ( _)
710
+ | ConstKind :: Infer ( _)
711
+ | ConstKind :: Bound ( ..)
712
+ | ConstKind :: Placeholder ( _) => V :: Result :: output ( ) ,
719
713
}
720
714
}
721
715
}
0 commit comments