rust/compiler/rustc_codegen_ssa/src
Nicholas Nethercote 4f008e06c3 Clarify Layout interning.
`Layout` is another type that is sometimes interned, sometimes not, and
we always use references to refer to it so we can't take any advantage
of the uniqueness properties for hashing or equality checks.

This commit renames `Layout` as `LayoutS`, and then introduces a new
`Layout` that is a newtype around an `Interned<LayoutS>`. It also
interns more layouts than before. Previously layouts within layouts
(via the `variants` field) were never interned, but now they are. Hence
the lifetime on the new `Layout` type.

Unlike other interned types, these ones are in `rustc_target` instead of
`rustc_middle`. This reflects the existing structure of the code, which
does layout-specific stuff in `rustc_target` while `TyAndLayout` is
generic over the `Ty`, allowing the type-specific stuff to occur in
`rustc_middle`.

The commit also adds a `HashStable` impl for `Interned`, which was
needed. It hashes the contents, unlike the `Hash` impl which hashes the
pointer.
2022-03-07 13:41:47 +11:00
..
back Rollup merge of #94433 - Urgau:check-cfg-allowness, r=petrochenkov 2022-03-03 01:09:12 +01:00
coverageinfo Remove in_band_lifetimes from rustc_codegen_ssa 2021-12-15 00:41:41 -05:00
debuginfo Clarify Layout interning. 2022-03-07 13:41:47 +11:00
mir rename ErrorReported -> ErrorGuaranteed 2022-03-02 09:45:25 -06:00
traits Introduce ConstAllocation. 2022-03-07 08:25:50 +11:00
base.rs Normalize main return type during mono item collection & codegen 2022-02-23 22:33:50 +01:00
common.rs Adopt let else in more places 2022-02-19 17:27:43 +01:00
glue.rs Attach range metadata to alignment loads from vtables 2021-12-05 16:07:27 -05:00
lib.rs Switch bootstrap cfgs 2022-02-25 08:00:52 -05:00
meth.rs Auto merge of #89597 - michaelwoerister:improve-vtable-debuginfo, r=wesleywiser 2021-10-11 04:31:47 +00:00
mono_item.rs rustc_target: move LayoutOf to ty::layout. 2021-09-02 01:17:14 +03:00
target_features.rs Rollup merge of #94339 - Amanieu:arm-d32, r=nagisa 2022-03-04 02:06:40 +01:00