@@ -232,6 +232,7 @@ TrivialLiftImpls! {
232232 crate :: mir:: Promoted ,
233233 crate :: mir:: interpret:: AllocId ,
234234 crate :: mir:: interpret:: Scalar ,
235+ crate :: ty:: ParamConst ,
235236 rustc_abi:: ExternAbi ,
236237 rustc_abi:: Size ,
237238 rustc_hir:: Safety ,
@@ -271,10 +272,6 @@ TrivialTypeTraversalImpls! {
271272 crate :: ty:: AssocItem ,
272273 crate :: ty:: AssocKind ,
273274 crate :: ty:: BoundRegion ,
274- crate :: ty:: BoundVar ,
275- crate :: ty:: InferConst ,
276- crate :: ty:: Placeholder <crate :: ty:: BoundRegion >,
277- crate :: ty:: Placeholder <ty:: BoundVar >,
278275 crate :: ty:: UserTypeAnnotationIndex ,
279276 crate :: ty:: ValTree <' tcx>,
280277 crate :: ty:: abstract_const:: NotConstEvaluatable ,
@@ -302,9 +299,8 @@ TrivialTypeTraversalImpls! {
302299// interners).
303300TrivialTypeTraversalAndLiftImpls ! {
304301 // tidy-alphabetical-start
305- crate :: ty:: ParamConst ,
306302 crate :: ty:: ParamTy ,
307- crate :: ty:: Placeholder < crate :: ty :: BoundTy > ,
303+ crate :: ty:: PlaceholderType ,
308304 crate :: ty:: instance:: ReifyReason ,
309305 rustc_hir:: def_id:: DefId ,
310306 // tidy-alphabetical-end
@@ -673,30 +669,30 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Const<'tcx> {
673669 folder : & mut F ,
674670 ) -> Result < Self , F :: Error > {
675671 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) ?) ,
682672 ConstKind :: Unevaluated ( uv) => ConstKind :: Unevaluated ( uv. try_fold_with ( folder) ?) ,
683673 ConstKind :: Value ( v) => ConstKind :: Value ( v. try_fold_with ( folder) ?) ,
684- ConstKind :: Error ( e) => ConstKind :: Error ( e. try_fold_with ( folder) ?) ,
685674 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 ) ,
686681 } ;
687682 if kind != self . kind ( ) { Ok ( folder. cx ( ) . mk_ct_from_kind ( kind) ) } else { Ok ( self ) }
688683 }
689684
690685 fn super_fold_with < F : TypeFolder < TyCtxt < ' tcx > > > ( self , folder : & mut F ) -> Self {
691686 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) ) ,
696687 ConstKind :: Unevaluated ( uv) => ConstKind :: Unevaluated ( uv. fold_with ( folder) ) ,
697688 ConstKind :: Value ( v) => ConstKind :: Value ( v. fold_with ( folder) ) ,
698- ConstKind :: Error ( e) => ConstKind :: Error ( e. fold_with ( folder) ) ,
699689 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 ,
700696 } ;
701697 if kind != self . kind ( ) { folder. cx ( ) . mk_ct_from_kind ( kind) } else { self }
702698 }
@@ -705,17 +701,15 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Const<'tcx> {
705701impl < ' tcx > TypeSuperVisitable < TyCtxt < ' tcx > > for ty:: Const < ' tcx > {
706702 fn super_visit_with < V : TypeVisitor < TyCtxt < ' tcx > > > ( & self , visitor : & mut V ) -> V :: Result {
707703 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) ,
715704 ConstKind :: Unevaluated ( uv) => uv. visit_with ( visitor) ,
716705 ConstKind :: Value ( v) => v. visit_with ( visitor) ,
717- ConstKind :: Error ( e) => e. visit_with ( visitor) ,
718706 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 ( ) ,
719713 }
720714 }
721715}
0 commit comments