rust/tests/ui/repr
Matthias Krüger f0a0f8f7e8
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.
2024-07-04 18:16:22 +02:00
..
auxiliary
16-bit-repr-c-enum.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
align-with-extern-c-fn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
aligned_enum_cast.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
attr-usage-repr.rs
attr-usage-repr.stderr
conflicting-repr-hints.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
conflicting-repr-hints.stderr Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
explicit-rust-repr-conflicts.rs Make #[repr(Rust)] and #[repr(C)] incompatible with one another 2023-10-18 17:25:23 +02:00
explicit-rust-repr-conflicts.stderr Bless tests 2024-01-13 12:46:58 -05:00
invalid_repr_list_help.rs Update ui tests 2024-02-29 14:43:43 +01:00
invalid_repr_list_help.stderr Update ui tests 2024-02-29 14:43:43 +01:00
issue-83505-repr-simd.rs
issue-83505-repr-simd.stderr
malformed-repr-hints.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
malformed-repr-hints.stderr Detect and reject malformed repr(Rust) hints 2023-11-27 12:29:21 +01:00
repr_c_int_align.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
repr-align-assign.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
repr-align-assign.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
repr-align-assign.stderr Add a note to duplicate diagnostics 2023-10-05 01:04:41 +00:00
repr-align.rs Use the Align type when parsing alignment attributes 2024-04-01 03:05:55 +01:00
repr-align.stderr Use the Align type when parsing alignment attributes 2024-04-01 03:05:55 +01:00
repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr Disable dead variant removal for #[repr(C)] enums. 2024-06-28 20:19:45 +03:00
repr-c-dead-variants.armebv7r-none-eabi.stderr Disable dead variant removal for #[repr(C)] enums. 2024-06-28 20:19:45 +03:00
repr-c-dead-variants.i686-pc-windows-msvc.stderr Disable dead variant removal for #[repr(C)] enums. 2024-06-28 20:19:45 +03:00
repr-c-dead-variants.rs Disable dead variant removal for #[repr(C)] enums. 2024-06-28 20:19:45 +03:00
repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr Disable dead variant removal for #[repr(C)] enums. 2024-06-28 20:19:45 +03:00
repr-c-int-dead-variants.rs Disable dead variant removal for #[repr(C)] enums. 2024-06-28 20:19:45 +03:00
repr-c-int-dead-variants.stderr Disable dead variant removal for #[repr(C)] enums. 2024-06-28 20:19:45 +03:00
repr-disallow-on-variant.rs
repr-disallow-on-variant.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
repr-packed-contains-align.rs
repr-packed-contains-align.stderr
repr-transparent-issue-87496.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
repr-transparent-issue-87496.stderr
repr-transparent-non-exhaustive.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
repr-transparent-non-exhaustive.stderr Don't complain on a single non-exhaustive 1-zst 2023-09-19 06:01:24 +00:00
repr-transparent-other-items.rs
repr-transparent-other-items.stderr
repr-transparent-other-reprs.rs
repr-transparent-other-reprs.stderr
repr-transparent.rs repr(transparent): it's fine if the one non-1-ZST field is a ZST 2023-08-29 14:11:50 +02:00
repr-transparent.stderr repr(transparent): it's fine if the one non-1-ZST field is a ZST 2023-08-29 14:11:50 +02:00
repr.rs
repr.stderr
transparent-enum-too-many-variants.rs
transparent-enum-too-many-variants.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00