Reorder fields in hir::ItemKind variants.

Specifically `TyAlias`, `Enum`, `Struct`, `Union`. So the fields match
the textual order in the source code.

The interesting part of the change is in
`compiler/rustc_hir/src/hir.rs`. The rest is extremely mechanical
refactoring.
This commit is contained in:
Nicholas Nethercote
2025-05-28 15:18:48 +10:00
parent 13718eb788
commit f8887aa5af
45 changed files with 184 additions and 186 deletions

View File

@@ -95,8 +95,8 @@ impl<'tcx> LateLintPass<'tcx> for DefaultCouldBeDerived {
kind:
hir::ItemKind::Struct(
_,
hir::VariantData::Struct { fields, recovered: _ },
_generics,
hir::VariantData::Struct { fields, recovered: _ },
),
..
})) => fields.iter().map(|f| (f.ident.name, f)).collect::<FxHashMap<_, _>>(),