rust/compiler/rustc_middle
Matthias Krüger 8a61ae0479
Rollup merge of #92203 - Aaron1011:mir-adt-def, r=oli-obk
Store a `DefId` instead of an `AdtDef` in `AggregateKind::Adt`

The `AggregateKind` enum ends up in the final mir `Body`. Currently,
any changes to `AdtDef` (regardless of how significant they are)
will legitimately cause the overall result of `optimized_mir` to change,
invalidating any codegen re-use involving that mir.

This will get worse once we start hashing the `Span` inside `FieldDef`
(which is itself contained in `AdtDef`).

To try to reduce these kinds of invalidations, this commit changes
`AggregateKind::Adt` to store just the `DefId`, instead of the full
`AdtDef`. This allows the result of `optimized_mir` to be unchanged
if the `AdtDef` changes in a way that doesn't actually affect any
of the MIR we build.
2021-12-23 17:48:31 +01:00
..
benches mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
src Rollup merge of #92203 - Aaron1011:mir-adt-def, r=oli-obk 2021-12-23 17:48:31 +01:00
Cargo.toml Update chalk to 0.75.0 2021-12-22 10:07:44 -06:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

For more information about how rustc works, see the rustc dev guide.