@@ -209,55 +209,56 @@ impl<'tcx> fmt::Debug for Region<'tcx> {
209
209
// For things for which the type library provides traversal implementations
210
210
// for all Interners, we only need to provide a Lift implementation:
211
211
TrivialLiftImpls ! {
212
- ( ) ,
213
- bool ,
214
- usize ,
215
- u64 ,
212
+ ( ) ,
213
+ bool ,
214
+ usize ,
215
+ u64 ,
216
+ crate :: ty:: ParamConst ,
216
217
}
217
218
218
219
// For some things about which the type library does not know, or does not
219
220
// provide any traversal implementations, we need to provide a traversal
220
221
// implementation (only for TyCtxt<'_> interners).
221
222
TrivialTypeTraversalImpls ! {
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 ! {
256
258
crate :: ty:: LateParamRegion ,
257
259
crate :: ty:: adjustment:: PointerCoercion ,
258
260
:: rustc_span:: Span ,
259
261
:: rustc_span:: symbol:: Ident ,
260
- ty:: BoundVar ,
261
262
}
262
263
// For some things about which the type library does not know, or does not
263
264
// provide any traversal implementations, we need to provide a traversal
@@ -268,7 +269,6 @@ TrivialTypeTraversalAndLiftImpls! {
268
269
:: rustc_hir:: Safety ,
269
270
:: rustc_target:: spec:: abi:: Abi ,
270
271
crate :: ty:: ClosureKind ,
271
- crate :: ty:: ParamConst ,
272
272
crate :: ty:: ParamTy ,
273
273
crate :: ty:: instance:: ReifyReason ,
274
274
interpret:: AllocId ,
@@ -578,12 +578,12 @@ impl<'tcx> TypeSuperFoldable<TyCtxt<'tcx>> for ty::Const<'tcx> {
578
578
folder : & mut F ,
579
579
) -> Result < Self , F :: Error > {
580
580
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) ?) ,
583
583
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) ?)
585
585
}
586
- ConstKind :: Placeholder ( p) => ConstKind :: Placeholder ( p. try_fold_with ( folder) ?) ,
586
+ ConstKind :: Placeholder ( p) => ConstKind :: Placeholder ( p. noop_try_fold_with ( folder) ?) ,
587
587
ConstKind :: Unevaluated ( uv) => ConstKind :: Unevaluated ( uv. try_fold_with ( folder) ?) ,
588
588
ConstKind :: Value ( t, v) => {
589
589
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> {
598
598
impl < ' tcx > TypeSuperVisitable < TyCtxt < ' tcx > > for ty:: Const < ' tcx > {
599
599
fn super_visit_with < V : TypeVisitor < TyCtxt < ' tcx > > > ( & self , visitor : & mut V ) -> V :: Result {
600
600
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) ,
603
603
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)
606
606
}
607
- ConstKind :: Placeholder ( p) => p. visit_with ( visitor) ,
607
+ ConstKind :: Placeholder ( p) => p. noop_visit_with ( visitor) ,
608
608
ConstKind :: Unevaluated ( uv) => uv. visit_with ( visitor) ,
609
609
ConstKind :: Value ( t, v) => {
610
610
try_visit ! ( t. visit_with( visitor) ) ;
611
- v. visit_with ( visitor)
611
+ v. noop_visit_with ( visitor)
612
612
}
613
613
ConstKind :: Error ( e) => e. visit_with ( visitor) ,
614
614
ConstKind :: Expr ( e) => e. visit_with ( visitor) ,
0 commit comments