about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/layout
AgeCommit message (Collapse)AuthorLines
2024-12-18make no-variant types a dedicated Variants variantRalf Jung-4/+4
2024-12-18Variants::Single: do not use invalid VariantIdx for uninhabited enumsRalf Jung-52/+70
2024-11-30improve TagEncoding::Niche docs and sanity checkRalf Jung-3/+13
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-1/+1
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-11-03compiler: Directly use rustc_abi in ty_utilsJubilee Young-1/+1
2024-10-29compiler: `rustc_abi::Abi` => `BackendRepr`Jubilee Young-21/+21
The initial naming of "Abi" was an awful mistake, conveying wrong ideas about how psABIs worked and even more about what the enum meant. It was only meant to represent the way the value would be described to a codegen backend as it was lowered to that intermediate representation. It was never meant to mean anything about the actual psABI handling! The conflation is because LLVM typically will associate a certain form with a certain ABI, but even that does not hold when the special cases that actually exist arise, plus the IR annotations that modify the ABI. Reframe `rustc_abi::Abi` as the `BackendRepr` of the type, and rename `BackendRepr::Aggregate` as `BackendRepr::Memory`. Unfortunately, due to the persistent misunderstandings, this too is now incorrect: - Scattered ABI-relevant code is entangled with BackendRepr - We do not always pre-compute a correct BackendRepr that reflects how we "actually" want this value to be handled, so we leave the backend interface to also inject various special-cases here - In some cases `BackendRepr::Memory` is a "real" aggregate, but in others it is in fact using memory, and in some cases it is a scalar! Our rustc-to-backend lowering code handles this sort of thing right now. That will eventually be addressed by lifting duplicated lowering code to either rustc_codegen_ssa or rustc_target as appropriate.
2024-10-28compiler: Add `is_uninhabited` and use LayoutS accessorsJubilee Young-4/+2
This reduces the need of the compiler to peek on the fields of LayoutS.
2024-10-20compiler: pre-move code for fixing enum layout ICEsJubilee Young-0/+296