rust/tests
Matthias Krüger e0aa5613d8
Rollup merge of #107592 - workingjubilee:use-16-bit-enum-on-16-bit-targets, r=WaffleLapkin
Default `repr(C)` enums to `c_int` size

This is what ISO C strongly implies this is correct, and
many processor-specific ABIs imply or mandate this size, so
"everyone" (LLVM, gcc...) defaults to emitting enums this way.
However, this is by no means guaranteed by ISO C,
and the bare-metal Arm targets show it can be overridden,
which rustc supports via `c-enum-min-bits` in a target.json.

The override is a flag named `-fshort-enums` in clang and gcc,
but introducing a CLI flag is probably unnecessary for rustc.
This flag can be used by non-Arm microcontroller targets,
like AVR and MSP430, but it is not enabled for them by default.
Rust programmers who know the size of a target's enums
can use explicit reprs, which also lets them match C23 code.

This change is most relevant to 16-bit targets: AVR and MSP430.
Most of rustc's targets use 32-bit ints, but ILP64 does exist.
Regardless, rustc should now correctly handle enums for
both very small and very large targets.

Thanks to William for confirming MSP430 behavior,
and to Waffle for better style and no-core `size_of` asserts.

Fixes rust-lang/rust#107361
Fixes rust-lang/rust#77806
2023-02-17 12:39:05 +01:00
..
assembly Update the minimum external LLVM to 14 2023-02-10 16:06:25 -08:00
auxiliary
codegen Auto merge of #107449 - saethlin:enable-copyprop, r=oli-obk 2023-02-16 03:44:37 +00:00
codegen-units
debuginfo Upgrade mingw-w64 on CI 2023-01-29 13:01:06 +01:00
incremental
mir-opt Auto merge of #107449 - saethlin:enable-copyprop, r=oli-obk 2023-02-16 03:44:37 +00:00
pretty Update tests. 2023-01-29 20:19:26 +01:00
run-make Auto merge of #105601 - BelovDV:change-rlib-with-not-stable, r=petrochenkov 2023-02-12 07:15:27 +00:00
run-make-fulldeps Remove save-analysis. 2023-02-16 15:14:45 +11:00
run-pass-valgrind
rustdoc Rollup merge of #108057 - GuillaumeGomez:fix-reexport-attr-merge, r=notriddle 2023-02-16 17:51:24 +01:00
rustdoc-gui Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, r=GuillaumeGomez 2023-02-13 11:34:56 +01:00
rustdoc-js rustdoc: update test cases to match with stricter match criteria 2023-01-21 00:11:39 -07:00
rustdoc-js-std rustdoc: add test case based on #103357 2023-01-24 09:49:33 -07:00
rustdoc-json
rustdoc-ui Remove save-analysis. 2023-02-16 15:14:45 +11:00
ui Rollup merge of #107592 - workingjubilee:use-16-bit-enum-on-16-bit-targets, r=WaffleLapkin 2023-02-17 12:39:05 +01:00
ui-fulldeps Forbid #[suggestion_*(...)] on Vecs 2023-02-01 21:49:45 +01:00
COMPILER_TESTS.md