rust/tests/ui/repr
Jubilee Young 2e19658315 Remove rustc's notion of "preferred" alignment AKA __alignof
In PR 90877 T-lang decided not to remove `intrinsics::pref_align_of`.
However, the intrinsic and its supporting code
1.  is a nightly feature, so can be removed at compiler/libs discretion
2.  requires considerable effort in the compiler to support, as it
    necessarily complicates every single site reasoning about alignment
3.  has been justified based on relevance to codegen, but it is only a
    requirement for C++ (not C, not Rust) stack frame layout for AIX,
    in ways Rust would not consider even with increased C++ interop
4.  is only used by rustc to overalign some globals, not correctness
5.  can be adequately replaced by other rules for globals, as it mostly
    affects alignments for a few types under 16 bytes of alignment
6.  has only one clear benefactor: automating C -> Rust translation
    for GNU extensions like `__alignof`
7.  such code was likely intended to be `alignof` or `_Alignof`,
    because the GNU extension is a "false friend" of the C keyword,
    which makes the choice to support such a mapping very questionable
8.  makes it easy to do incorrect codegen in the compiler by its mere
    presence as usual Rust rules of alignment (e.g. `size == align * N`)
    do not hold with preferred alignment

The implementation is clearly damaging the code quality of the compiler.
Thus it is within the compiler team's purview to simply rip it out.
If T-lang wishes to have this intrinsic restored for c2rust's benefit,
it would have to use a radically different implementation that somehow
does not cause internal incorrectness.

Until then, remove the intrinsic and its supporting code, as one tool
and an ill-considered GCC extension cannot justify risking correctness.

Because we touch a fair amount of the compiler to change this at all,
and unfortunately the duplication of AbiAndPrefAlign is deep-rooted,
we keep an "AbiAlign" type which we can wean code off later.
2025-06-08 16:41:46 -07:00
..
auxiliary
16-bit-repr-c-enum.rs tests: use minicore more 2025-02-24 09:26:54 +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 UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
attr-usage-repr.stderr disallow repr() on invalid items 2024-12-05 16:44:00 +01:00
conflicting-repr-hints.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
conflicting-repr-hints.stderr bump conflicting_repr_hints lint to be shown in dependencies 2024-08-06 11:17:26 +02:00
explicit-rust-repr-conflicts.rs Ban non-array SIMD 2024-09-09 19:39:43 -07: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 Fix test output expectations 2025-02-24 14:31:19 +01:00
issue-83505-repr-simd.rs warn about broken simd not only on structs but also enums and unions when we didn't opt in to it 2025-01-07 21:36:37 +01:00
issue-83505-repr-simd.stderr Fix test output expectations 2025-02-24 14:31:19 +01:00
malformed-repr-hints.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
malformed-repr-hints.stderr Fix test output expectations 2025-02-24 14:31:19 +01:00
repr-align-assign.fixed Fix test output expectations 2025-02-24 14:31:19 +01:00
repr-align-assign.rs Fix test output expectations 2025-02-24 14:31:19 +01:00
repr-align-assign.stderr Fix test output expectations 2025-02-24 14:31:19 +01:00
repr-align.rs Fix test output expectations 2025-02-24 14:31:19 +01:00
repr-align.stderr Fix test output expectations 2025-02-24 14:31:19 +01:00
repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr Remove rustc's notion of "preferred" alignment AKA __alignof 2025-06-08 16:41:46 -07:00
repr-c-dead-variants.armebv7r-none-eabi.stderr Remove rustc's notion of "preferred" alignment AKA __alignof 2025-06-08 16:41:46 -07:00
repr-c-dead-variants.i686-pc-windows-msvc.stderr Remove rustc's notion of "preferred" alignment AKA __alignof 2025-06-08 16:41:46 -07:00
repr-c-dead-variants.rs tests: use minicore more 2025-02-24 09:26:54 +00:00
repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr Remove rustc's notion of "preferred" alignment AKA __alignof 2025-06-08 16:41:46 -07:00
repr-c-int-dead-variants.rs adjust UI tests 2025-01-10 02:22:57 +01:00
repr-c-int-dead-variants.stderr Remove rustc's notion of "preferred" alignment AKA __alignof 2025-06-08 16:41:46 -07: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-empty-packed.rs continue to check attr if meet empty repr for adt 2025-03-09 10:51:50 +08:00
repr-empty-packed.stderr continue to check attr if meet empty repr for adt 2025-03-09 10:51:50 +08: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-transparent-in-prose.rs repr_transparent_external_private_fields: treat rustc_pub_transparent types as local 2024-08-24 23:05:54 +03:00
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 Fix test output expectations 2025-02-24 14:31:19 +01:00
repr.rs
repr.stderr
repr_align_greater_usize.msp430.stderr tests: use minicore more 2025-02-24 09:26:54 +00:00
repr_align_greater_usize.rs tests: use minicore more 2025-02-24 09:26:54 +00:00
repr_c_int_align.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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