Reorder ast::ItemKind::{Struct,Enum,Union} fields.

So they match the order of the parts in the source code, e.g.:
```
struct Foo<T, U> { t: T, u: U }
       <-><----> <------------>
       /   |       \
   ident generics  variant_data
```
This commit is contained in:
Nicholas Nethercote
2025-05-28 08:20:30 +10:00
parent c583fa6d84
commit 4c4a40f6df
20 changed files with 54 additions and 56 deletions

View File

@@ -823,7 +823,7 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
}
// These items live in both the type and value namespaces.
ItemKind::Struct(ident, ref vdata, _) => {
ItemKind::Struct(ident, _, ref vdata) => {
self.build_reduced_graph_for_struct_variant(
vdata.fields(),
ident,
@@ -874,7 +874,7 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
}
}
ItemKind::Union(ident, ref vdata, _) => {
ItemKind::Union(ident, _, ref vdata) => {
self.build_reduced_graph_for_struct_variant(
vdata.fields(),
ident,