Skip to content

Commit d282a67

Browse files
committed
Fix whitespace in lift macros.
This has been bugging me for some time.
1 parent d28678e commit d282a67

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

compiler/rustc_middle/src/ty/context.rs

+16-14
Original file line numberDiff line numberDiff line change
@@ -2243,21 +2243,23 @@ macro_rules! nop_list_lift {
22432243
};
22442244
}
22452245

2246-
nop_lift! {type_; Ty<'a> => Ty<'tcx>}
2247-
nop_lift! {region; Region<'a> => Region<'tcx>}
2248-
nop_lift! {const_; Const<'a> => Const<'tcx>}
2249-
nop_lift! {pat; Pattern<'a> => Pattern<'tcx>}
2250-
nop_lift! {const_allocation; ConstAllocation<'a> => ConstAllocation<'tcx>}
2251-
nop_lift! {predicate; Predicate<'a> => Predicate<'tcx>}
2252-
nop_lift! {predicate; Clause<'a> => Clause<'tcx>}
2253-
nop_lift! {layout; Layout<'a> => Layout<'tcx>}
2254-
2255-
nop_list_lift! {type_lists; Ty<'a> => Ty<'tcx>}
2256-
nop_list_lift! {poly_existential_predicates; PolyExistentialPredicate<'a> => PolyExistentialPredicate<'tcx>}
2257-
nop_list_lift! {bound_variable_kinds; ty::BoundVariableKind => ty::BoundVariableKind}
2246+
nop_lift! { type_; Ty<'a> => Ty<'tcx> }
2247+
nop_lift! { region; Region<'a> => Region<'tcx> }
2248+
nop_lift! { const_; Const<'a> => Const<'tcx> }
2249+
nop_lift! { pat; Pattern<'a> => Pattern<'tcx> }
2250+
nop_lift! { const_allocation; ConstAllocation<'a> => ConstAllocation<'tcx> }
2251+
nop_lift! { predicate; Predicate<'a> => Predicate<'tcx> }
2252+
nop_lift! { predicate; Clause<'a> => Clause<'tcx> }
2253+
nop_lift! { layout; Layout<'a> => Layout<'tcx> }
2254+
2255+
nop_list_lift! { type_lists; Ty<'a> => Ty<'tcx> }
2256+
nop_list_lift! {
2257+
poly_existential_predicates; PolyExistentialPredicate<'a> => PolyExistentialPredicate<'tcx>
2258+
}
2259+
nop_list_lift! { bound_variable_kinds; ty::BoundVariableKind => ty::BoundVariableKind }
22582260

22592261
// This is the impl for `&'a GenericArgs<'a>`.
2260-
nop_list_lift! {args; GenericArg<'a> => GenericArg<'tcx>}
2262+
nop_list_lift! { args; GenericArg<'a> => GenericArg<'tcx> }
22612263

22622264
macro_rules! nop_slice_lift {
22632265
($ty:ty => $lifted:ty) => {
@@ -2277,7 +2279,7 @@ macro_rules! nop_slice_lift {
22772279
};
22782280
}
22792281

2280-
nop_slice_lift! {ty::ValTree<'a> => ty::ValTree<'tcx>}
2282+
nop_slice_lift! { ty::ValTree<'a> => ty::ValTree<'tcx> }
22812283

22822284
macro_rules! sty_debug_print {
22832285
($fmt: expr, $ctxt: expr, $($variant: ident),*) => {{

compiler/rustc_middle/src/ty/structural_impls.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -230,20 +230,23 @@ TrivialLiftImpls! {
230230
bool,
231231
usize,
232232
u64,
233-
crate::mir::Promoted,
233+
// tidy-alphabetical-start
234234
crate::mir::interpret::AllocId,
235235
crate::mir::interpret::Scalar,
236+
crate::mir::Promoted,
236237
rustc_abi::ExternAbi,
237238
rustc_abi::Size,
238239
rustc_hir::Safety,
239240
rustc_type_ir::BoundConstness,
240241
rustc_type_ir::PredicatePolarity,
242+
// tidy-alphabetical-end
241243
}
242244

243245
// For some things about which the type library does not know, or does not
244246
// provide any traversal implementations, we need to provide a traversal
245247
// implementation (only for TyCtxt<'_> interners).
246248
TrivialTypeTraversalImpls! {
249+
// tidy-alphabetical-start
247250
crate::infer::canonical::Certainty,
248251
crate::mir::BasicBlock,
249252
crate::mir::BindingForm<'tcx>,
@@ -265,6 +268,9 @@ TrivialTypeTraversalImpls! {
265268
crate::mir::SwitchTargets,
266269
crate::traits::IsConstable,
267270
crate::traits::OverflowError,
271+
crate::ty::abstract_const::NotConstEvaluatable,
272+
crate::ty::adjustment::AutoBorrowMutability,
273+
crate::ty::adjustment::PointerCoercion,
268274
crate::ty::AdtKind,
269275
crate::ty::AssocItem,
270276
crate::ty::AssocKind,
@@ -275,32 +281,32 @@ TrivialTypeTraversalImpls! {
275281
crate::ty::Placeholder<ty::BoundVar>,
276282
crate::ty::UserTypeAnnotationIndex,
277283
crate::ty::ValTree<'tcx>,
278-
crate::ty::abstract_const::NotConstEvaluatable,
279-
crate::ty::adjustment::AutoBorrowMutability,
280-
crate::ty::adjustment::PointerCoercion,
281284
rustc_abi::FieldIdx,
282285
rustc_abi::VariantIdx,
283286
rustc_ast::InlineAsmOptions,
284287
rustc_ast::InlineAsmTemplatePiece,
285288
rustc_hir::CoroutineKind,
289+
rustc_hir::def_id::LocalDefId,
286290
rustc_hir::HirId,
287291
rustc_hir::MatchSource,
288-
rustc_hir::def_id::LocalDefId,
289292
rustc_span::Ident,
290293
rustc_span::Span,
291294
rustc_span::Symbol,
292295
rustc_target::asm::InlineAsmRegOrRegClass,
296+
// tidy-alphabetical-end
293297
}
294298

295299
// For some things about which the type library does not know, or does not
296300
// provide any traversal implementations, we need to provide a traversal
297301
// implementation and a lift implementation (the former only for TyCtxt<'_>
298302
// interners).
299303
TrivialTypeTraversalAndLiftImpls! {
304+
// tidy-alphabetical-start
305+
crate::ty::instance::ReifyReason,
300306
crate::ty::ParamConst,
301307
crate::ty::ParamTy,
302-
crate::ty::instance::ReifyReason,
303308
rustc_hir::def_id::DefId,
309+
// tidy-alphabetical-end
304310
}
305311

306312
///////////////////////////////////////////////////////////////////////////

compiler/rustc_type_ir/src/macros.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ TrivialTypeTraversalImpls! {
4747
u16,
4848
u32,
4949
u64,
50+
// tidy-alphabetical-start
5051
crate::AliasRelationDirection,
5152
crate::BoundConstness,
5253
crate::DebruijnIndex,
5354
crate::PredicatePolarity,
54-
crate::UniverseIndex,
55-
crate::Variance,
5655
crate::solve::BuiltinImplSource,
5756
crate::solve::Certainty,
5857
crate::solve::GoalSource,
58+
crate::UniverseIndex,
59+
crate::Variance,
5960
rustc_ast_ir::Mutability,
61+
// tidy-alphabetical-end
6062
}

0 commit comments

Comments
 (0)