rust/tests
Jubilee d4f23cdc91
Rollup merge of #142570 - jieyouxu:disunion, r=estebank
Reject union default field values

Fixes rust-lang/rust#142555.

The [`default_field_values` RFC][rfc] does not specify that default field values may be used on `union`s, and it's not clear how default field values may be used with `union`s without an design extension to the RFC. So, for now, reject trying to use default field values with `union`s.

### Review notes

- The first commit adds the `union` with default field values test case to `tests/ui/structs/default-field-values/failures.rs`, where `union`s with default field values are currently accepted.
- The second commit rejects trying to supply default field values to `union` definitions.
- When `default_field_values` feature gate is disabled, we show the feature gate error when the user tries to write `union`s with default field values. When the feature gate is enabled, we reject this usage with
   > unions cannot have default field values

``@rustbot`` label: +F-default_field_values

[rfc]: https://rust-lang.github.io/rfcs/3681-default-field-values.html
2025-06-17 00:28:17 -07:00
..
assembly Rollup merge of #142565 - bjorn3:wasm32_unknown_naked_asm_test, r=RalfJung 2025-06-16 19:54:36 +02:00
auxiliary stabilize naked_functions 2025-04-20 11:18:38 +02:00
codegen Fix RISC-V C function ABI when passing/returning structs containing floats 2025-06-16 10:14:07 +01:00
codegen-units Remove mono item collection strategy override from -Zprint-mono-items 2025-05-09 12:19:09 +02:00
coverage coverage: Revert "unused local file IDs" due to empty function names 2025-05-27 23:33:29 +10:00
coverage-run-rustdoc
crashes Rollup merge of #142347 - azhogin:azhogin/async-drop-storage-live-dead-fix, r=oli-obk 2025-06-15 23:51:56 +02:00
debuginfo tests: Change "fastcall" to "system" in some tests 2025-06-09 16:10:21 -07:00
incremental tests: Change "fastcall" to "system" in some tests 2025-06-09 16:10:21 -07:00
mir-opt Rollup merge of #142347 - azhogin:azhogin/async-drop-storage-live-dead-fix, r=oli-obk 2025-06-15 23:51:56 +02:00
pretty Rollup merge of #134847 - dtolnay:asymmetrical, r=fmease 2025-06-13 05:16:54 +02:00
run-make Don't match on platform-specific directory not found message 2025-06-17 10:53:11 +08:00
rustdoc Auto merge of #142443 - matthiaskrgr:rollup-l1l6d0v, r=matthiaskrgr 2025-06-13 17:44:15 +00:00
rustdoc-gui Rollup merge of #139831 - lolbinarycat:rustdoc-mobile-sidebar, r=GuillaumeGomez 2025-05-25 04:00:55 +02:00
rustdoc-js yeet CanonicalVarInfo 2025-05-23 12:10:53 +00:00
rustdoc-js-std Consistent trait bounds for ExtractIf Debug impls 2025-05-05 19:46:46 -07:00
rustdoc-json rustdoc-json: Rearrange deck chairs in ABI testing 2025-06-09 16:11:06 -07:00
rustdoc-ui Add new extracted option doctest ui test for result returning doctest 2025-06-10 13:54:47 +02:00
ui Rollup merge of #142570 - jieyouxu:disunion, r=estebank 2025-06-17 00:28:17 -07:00
ui-fulldeps Fix test description 2025-06-16 10:51:59 +03:00
COMPILER_TESTS.md