rust/src/test/ui/union
Mazdak Farrokhzad aba84894d1
Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJung
Change untagged_unions to not allow union fields with drop

This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass.

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).

The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.

Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-21 22:00:45 +02:00
..
auxiliary tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
issue-41073.rs Fixes #41073, it is no longer an ICE 2019-10-11 10:43:54 +02:00
issue-41073.stderr Fixes #41073, it is no longer an ICE 2019-10-11 10:43:54 +02:00
union-align.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-backcomp.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-basic.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-borrow-move-parent-sibling.rs Remove most uses of allow(unions_with_drop_fields) in tests 2019-10-11 10:43:54 +02:00
union-borrow-move-parent-sibling.stderr Change untagged_unions to not allow union fields with drop 2019-10-11 10:43:54 +02:00
union-const-codegen.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-const-eval-field.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-const-eval.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
union-const-pat.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-const-pat.stderr Update tests 2019-03-11 23:10:26 +03:00
union-copy.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-copy.stderr Update tests 2019-03-11 23:10:26 +03:00
union-custom-drop.rs Ensure we do not treat all unions as not having any drop glue. 2019-10-11 10:43:55 +02:00
union-custom-drop.stderr Update ui stderr 2019-10-11 10:43:55 +02:00
union-derive-clone.rs Change untagged_unions to not allow union fields with drop 2019-10-11 10:43:54 +02:00
union-derive-clone.stderr rpass tests are now part of ui tests 2019-10-11 10:43:54 +02:00
union-derive-eq.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-derive-eq.stderr Update tests 2019-03-11 23:10:26 +03:00
union-derive-rpass.rs Remove most uses of allow(unions_with_drop_fields) in tests 2019-10-11 10:43:54 +02:00
union-derive.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-derive.stderr Update tests 2019-03-11 23:10:26 +03:00
union-drop-assign.rs Remove most uses of allow(unions_with_drop_fields) in tests 2019-10-11 10:43:54 +02:00
union-drop.rs Remove most uses of allow(unions_with_drop_fields) in tests 2019-10-11 10:43:54 +02:00
union-empty.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-empty.stderr Update tests 2019-03-11 23:10:26 +03:00
union-fields-1.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-fields-1.stderr Update tests 2019-03-11 23:10:26 +03:00
union-fields-2.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-fields-2.stderr hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
union-generic-rpass.rs Preserve originally intended test semantics 2019-10-11 10:43:54 +02:00
union-generic.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-generic.stderr Use span label instead of note for cause in E0631 2019-08-31 00:14:23 -07:00
union-inherent-method.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-lint-dead-code.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-lint-dead-code.stderr Update tests 2019-03-11 23:10:26 +03:00
union-macro.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-manuallydrop-rpass.rs rpass tests are now part of ui tests 2019-10-11 10:43:54 +02:00
union-nodrop.rs Extend union-nodrop.rs test 2019-10-11 10:43:54 +02:00
union-nonrepresentable.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-nonrepresentable.stderr Update tests 2019-03-11 23:10:26 +03:00
union-nonzero.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-overwrite.rs Remove most uses of allow(unions_with_drop_fields) in tests 2019-10-11 10:43:54 +02:00
union-packed.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-pat-refutability.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-repr-c.rs Refactor "not FFI-safe" diagnostic 2019-09-10 22:29:31 +01:00
union-repr-c.stderr Refactor "not FFI-safe" diagnostic 2019-09-10 22:29:31 +01:00
union-sized-field.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-sized-field.stderr Handle more cases 2019-10-15 13:55:43 -07:00
union-suggest-field.rs use structured suggestion for method calls 2019-01-03 13:42:52 -05:00
union-suggest-field.stderr hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
union-trait-impl.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-transmute.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
union-unsafe.rs Change untagged_unions to not allow union fields with drop 2019-10-11 10:43:54 +02:00
union-unsafe.stderr Change untagged_unions to not allow union fields with drop 2019-10-11 10:43:54 +02:00
union-unsized.rs Remove licenses 2018-12-25 21:08:33 -07:00
union-unsized.stderr Fix broken links to second edition TRPL. 2019-01-01 12:53:07 -05:00
union-with-drop-fields.rs Change untagged_unions to not allow union fields with drop 2019-10-11 10:43:54 +02:00
union-with-drop-fields.stderr Change untagged_unions to not allow union fields with drop 2019-10-11 10:43:54 +02:00