Files
rust/compiler/rustc_mir_transform/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
..
2022-03-01 07:43:12 -03:00
2022-02-19 17:27:43 +01:00
2022-02-20 21:00:12 +01:00
2022-03-07 08:25:50 +11:00
2022-02-19 17:27:43 +01:00
2022-03-01 07:43:12 -03:00
2022-02-15 16:03:24 +11:00
2022-03-01 07:43:12 -03:00
2022-03-01 07:43:12 -03:00
2022-03-01 07:43:12 -03:00
2021-12-02 17:31:38 -08:00
2022-02-19 17:27:43 +01:00
2022-02-19 17:27:43 +01:00
2022-02-15 16:03:24 +11:00
2022-02-21 07:09:11 +01:00
2022-02-19 17:27:43 +01:00