@@ -209,55 +209,56 @@ impl<'tcx> fmt::Debug for Region<'tcx> {
209209// For things for which the type library provides traversal implementations
210210// for all Interners, we only need to provide a Lift implementation:
211211TrivialLiftImpls ! {
212- ( ) ,
213- bool ,
214- usize ,
215- u64 ,
212+ ( ) ,
213+ bool ,
214+ usize ,
215+ u64 ,
216+ crate :: ty:: ParamConst ,
216217}
217218
218219// For some things about which the type library does not know, or does not
219220// provide any traversal implementations, we need to provide a traversal
220221// implementation (only for TyCtxt<'_> interners).
221222TrivialTypeTraversalImpls ! {
222- :: rustc_target:: abi:: FieldIdx ,
223- :: rustc_target:: abi:: VariantIdx ,
224- crate :: middle:: region:: Scope ,
225- :: rustc_ast:: InlineAsmOptions ,
226- :: rustc_ast:: InlineAsmTemplatePiece ,
227- :: rustc_ast:: NodeId ,
228- :: rustc_span:: symbol:: Symbol ,
229- :: rustc_hir:: def:: Res ,
230- :: rustc_hir:: def_id:: LocalDefId ,
231- :: rustc_hir:: ByRef ,
232- :: rustc_hir:: HirId ,
233- :: rustc_hir:: RangeEnd ,
234- :: rustc_hir:: MatchSource ,
235- :: rustc_target:: asm:: InlineAsmRegOrRegClass ,
236- crate :: mir:: coverage:: BlockMarkerId ,
237- crate :: mir:: coverage:: CounterId ,
238- crate :: mir:: coverage:: ExpressionId ,
239- crate :: mir:: coverage:: ConditionId ,
240- crate :: mir:: Local ,
241- crate :: mir:: Promoted ,
242- crate :: traits:: Reveal ,
243- crate :: ty:: adjustment:: AutoBorrowMutability ,
244- crate :: ty:: AdtKind ,
245- crate :: ty:: BoundRegion ,
246- // Including `BoundRegionKind` is a *bit* dubious, but direct
247- // references to bound region appear in `ty::Error`, and aren't
248- // really meant to be folded. In general, we can only fold a fully
249- // general `Region`.
250- crate :: ty:: BoundRegionKind ,
251- crate :: ty:: AssocItem ,
252- crate :: ty:: AssocKind ,
253- crate :: ty:: Placeholder <crate :: ty:: BoundRegion >,
254- crate :: ty:: Placeholder <crate :: ty:: BoundTy >,
255- crate :: ty:: Placeholder <ty:: BoundVar >,
223+ :: rustc_target:: abi:: FieldIdx ,
224+ :: rustc_target:: abi:: VariantIdx ,
225+ crate :: middle:: region:: Scope ,
226+ :: rustc_ast:: InlineAsmOptions ,
227+ :: rustc_ast:: InlineAsmTemplatePiece ,
228+ :: rustc_ast:: NodeId ,
229+ :: rustc_ast:: ast:: BindingMode ,
230+ :: rustc_span:: symbol:: Symbol ,
231+ :: rustc_hir:: def:: Res ,
232+ :: rustc_hir:: def_id:: LocalDefId ,
233+ :: rustc_hir:: ByRef ,
234+ :: rustc_hir:: HirId ,
235+ :: rustc_hir:: RangeEnd ,
236+ :: rustc_hir:: MatchSource ,
237+ :: rustc_target:: asm:: InlineAsmRegOrRegClass ,
238+ crate :: mir:: coverage:: BlockMarkerId ,
239+ crate :: mir:: coverage:: CounterId ,
240+ crate :: mir:: coverage:: ExpressionId ,
241+ crate :: mir:: coverage:: ConditionId ,
242+ crate :: mir:: Local ,
243+ crate :: mir:: Promoted ,
244+ crate :: ty:: adjustment:: AutoBorrowMutability ,
245+ crate :: ty:: AdtKind ,
246+ crate :: ty:: BoundRegion ,
247+ // Including `BoundRegionKind` is a *bit* dubious, but direct
248+ // references to bound region appear in `ty::Error`, and aren't
249+ // really meant to be folded. In general, we can only fold a fully
250+ // general `Region`.
251+ crate :: ty:: BoundRegionKind ,
252+ crate :: ty:: AssocItem ,
253+ crate :: ty:: AssocKind ,
254+ crate :: ty:: Placeholder <crate :: ty:: BoundRegion >,
255+ crate :: ty:: Placeholder <crate :: ty:: BoundTy >,
256+ crate :: ty:: Placeholder <ty:: BoundVar >, }
257+ TrivialTypeTraversalImpls ! {
256258 crate :: ty:: LateParamRegion ,
257259 crate :: ty:: adjustment:: PointerCoercion ,
258260 :: rustc_span:: Span ,
259261 :: rustc_span:: symbol:: Ident ,
260- ty:: BoundVar ,
261262}
262263// For some things about which the type library does not know, or does not
263264// provide any traversal implementations, we need to provide a traversal
@@ -268,7 +269,6 @@ TrivialTypeTraversalAndLiftImpls! {
268269 :: rustc_hir:: Safety ,
269270 :: rustc_target:: spec:: abi:: Abi ,
270271 crate :: ty:: ClosureKind ,
271- crate :: ty:: ParamConst ,
272272 crate :: ty:: ParamTy ,
273273 crate :: ty:: instance:: ReifyReason ,
274274 interpret:: AllocId ,
@@ -578,12 +578,12 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Const<'tcx> {
578578 folder : & mut F ,
579579 ) -> Result < Self , F :: Error > {
580580 let kind = match self . kind ( ) {
581- ConstKind :: Param ( p) => ConstKind :: Param ( p. try_fold_with ( folder) ?) ,
582- ConstKind :: Infer ( i) => ConstKind :: Infer ( i. try_fold_with ( folder) ?) ,
581+ ConstKind :: Param ( p) => ConstKind :: Param ( p. noop_try_fold_with ( folder) ?) ,
582+ ConstKind :: Infer ( i) => ConstKind :: Infer ( i. noop_try_fold_with ( folder) ?) ,
583583 ConstKind :: Bound ( d, b) => {
584- ConstKind :: Bound ( d. try_fold_with ( folder) ?, b. try_fold_with ( folder) ?)
584+ ConstKind :: Bound ( d. noop_try_fold_with ( folder) ?, b. noop_try_fold_with ( folder) ?)
585585 }
586- ConstKind :: Placeholder ( p) => ConstKind :: Placeholder ( p. try_fold_with ( folder) ?) ,
586+ ConstKind :: Placeholder ( p) => ConstKind :: Placeholder ( p. noop_try_fold_with ( folder) ?) ,
587587 ConstKind :: Unevaluated ( uv) => ConstKind :: Unevaluated ( uv. try_fold_with ( folder) ?) ,
588588 ConstKind :: Value ( t, v) => {
589589 ConstKind :: Value ( t. try_fold_with ( folder) ?, v. noop_try_fold_with ( folder) ?)
@@ -598,17 +598,17 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Const<'tcx> {
598598impl < ' tcx > TypeSuperVisitable < TyCtxt < ' tcx > > for ty:: Const < ' tcx > {
599599 fn super_visit_with < V : TypeVisitor < TyCtxt < ' tcx > > > ( & self , visitor : & mut V ) -> V :: Result {
600600 match self . kind ( ) {
601- ConstKind :: Param ( p) => p. visit_with ( visitor) ,
602- ConstKind :: Infer ( i) => i. visit_with ( visitor) ,
601+ ConstKind :: Param ( p) => p. noop_visit_with ( visitor) ,
602+ ConstKind :: Infer ( i) => i. noop_visit_with ( visitor) ,
603603 ConstKind :: Bound ( d, b) => {
604- try_visit ! ( d. visit_with ( visitor) ) ;
605- b. visit_with ( visitor)
604+ try_visit ! ( d. noop_visit_with ( visitor) ) ;
605+ b. noop_visit_with ( visitor)
606606 }
607- ConstKind :: Placeholder ( p) => p. visit_with ( visitor) ,
607+ ConstKind :: Placeholder ( p) => p. noop_visit_with ( visitor) ,
608608 ConstKind :: Unevaluated ( uv) => uv. visit_with ( visitor) ,
609609 ConstKind :: Value ( t, v) => {
610610 try_visit ! ( t. visit_with( visitor) ) ;
611- v. visit_with ( visitor)
611+ v. noop_visit_with ( visitor)
612612 }
613613 ConstKind :: Error ( e) => e. visit_with ( visitor) ,
614614 ConstKind :: Expr ( e) => e. visit_with ( visitor) ,
0 commit comments