rust/compiler/rustc_codegen_ssa/src
Nicholas Nethercote 4852291417 Introduce ConstAllocation.
Currently some `Allocation`s are interned, some are not, and it's very
hard to tell at a use point which is which.

This commit introduces `ConstAllocation` for the known-interned ones,
which makes the division much clearer. `ConstAllocation::inner()` is
used to get the underlying `Allocation`.

In some places it's natural to use an `Allocation`, in some it's natural
to use a `ConstAllocation`, and in some places there's no clear choice.
I've tried to make things look as nice as possible, while generally
favouring `ConstAllocation`, which is the type that embodies more
information. This does require quite a few calls to `inner()`.

The commit also tweaks how `PartialOrd` works for `Interned`. The
previous code was too clever by half, building on `T: Ord` to make the
code shorter. That caused problems with deriving `PartialOrd` and `Ord`
for `ConstAllocation`, so I changed it to build on `T: PartialOrd`,
which is slightly more verbose but much more standard and avoided the
problems.
2022-03-07 08:25:50 +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 all: fix some typos 2022-03-03 19:47:23 +08: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