diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-07-04 18:16:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-04 18:16:22 +0200 |
| commit | f0a0f8f7e8adae3f5abf945af9c9f3b2f95af43b (patch) | |
| tree | 7e4c968a3cf59040a841a1648ff576be464ec65e /compiler/rustc_llvm/llvm-wrapper/Linker.cpp | |
| parent | e2cf31a6148725bde4ea48acf1e4fe72675257a2 (diff) | |
| parent | 8a3c07afbe94ff892b9fef982dea3ba1af7c7a5a (diff) | |
| download | rust-f0a0f8f7e8adae3f5abf945af9c9f3b2f95af43b.tar.gz rust-f0a0f8f7e8adae3f5abf945af9c9f3b2f95af43b.zip | |
Rollup merge of #123043 - GoldsteinE:fix/repr-c-dead-branches, r=oli-obk
Disable dead variant removal for `#[repr(C)]` enums.
This prevents removing dead branches from a `#[repr(C)]` enum (they now get discriminants allocated as if they were inhabited).
Implementation notes: ABI of something like
```rust
#[repr(C)]
enum Foo {
Foo(!),
}
```
is still `Uninhabited`, but its layout is now computed as if all the branches were inhabited.
This seemed to me like a proper way to do it, especially given that ABI sanity check explicitly asserts that type-level uninhabitedness implies ABI uninhabitedness.
This probably needs some sort of FCP (given that it changes `#[repr(C)]` layout, which is a stable guarantee), but I’m not sure how to call for one or which team is the most relevant.
See https://github.com/rust-lang/unsafe-code-guidelines/issues/500.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions
