rust/tests/ui/abi
Matthias Krüger f0a0f8f7e8
Rollup merge of - 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
..
cross-crate Remove libc from rust_get_test_int uses 2024-04-17 09:18:14 -04:00
extern Clean up users of rust_dbg_call 2024-04-17 15:08:08 -04:00
foreign Clean up users of rust_dbg_call 2024-04-17 15:08:08 -04:00
issues Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
mir Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
numbers-arithmetic [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
statics Use the rustc_private libc less in tests 2024-04-15 08:54:11 -04:00
struct-enums Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
union Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
abi-sysv64-arg-passing.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
abi-sysv64-register-usage.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
abi-typo-unstable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
abi-typo-unstable.stderr Fix remaining cases 2024-06-21 19:00:18 -04:00
anon-extern-mod.rs Remove libc from rust_get_test_int uses 2024-04-17 09:18:14 -04:00
arm-unadjusted-intrinsic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
c-stack-as-value.rs Remove libc from rust_get_test_int uses 2024-04-17 09:18:14 -04:00
c-stack-returning-int64.rs Use the rustc_private libc less in tests 2024-04-15 08:54:11 -04:00
cabi-int-widening.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
compatibility.rs Rollup merge of - GoldsteinE:fix/repr-c-dead-branches, r=oli-obk 2024-07-04 18:16:22 +02:00
debug.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
debug.stderr Refactor float Primitives to a separate Float type 2024-05-06 14:56:10 +01:00
explicit_repr_rust.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fixed_x18.rs Simplify check for unsupported architectures 2024-05-29 16:58:46 +02:00
homogenous-floats-target-feature-mixup.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
issue-28676.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
lib-defaults.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
nullable-pointer-ffi-compat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
relocation_model_pic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
riscv-discoverability-guidance.riscv32.stderr Fix remaining cases 2024-06-21 19:00:18 -04:00
riscv-discoverability-guidance.riscv64.stderr Fix remaining cases 2024-06-21 19:00:18 -04:00
riscv-discoverability-guidance.rs llvm: update riscv target feature to match LLVM 19 2024-04-17 16:15:24 -04:00
rustcall-generic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
segfault-no-out-of-stack.rs Remove libc from more tests 2024-04-17 08:36:49 -04:00
stack-probes-lto.rs Disable stack overflow handler tests on iOS-like platforms 2024-05-28 12:31:12 +02:00
stack-probes.rs Disable stack overflow handler tests on iOS-like platforms 2024-05-28 12:31:12 +02:00
stack-protector.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsized-args-in-c-abi-issues-94223-115845.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsupported.aarch64.stderr Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
unsupported.arm.stderr Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
unsupported.i686.stderr Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
unsupported.riscv32.stderr Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
unsupported.riscv64.stderr Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
unsupported.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsupported.x64.stderr Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
variadic-ffi.rs Allow "C-unwind" fn to have C variadics 2024-06-22 15:14:14 -07:00
x86stdcall2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
x86stdcall.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00