reference icon indicating copy to clipboard operation
reference copied to clipboard

Remove outdated note about non-Copy union fields

Open GoldsteinE opened this issue 3 years ago • 4 comments

Unions with non-Copy fields are now stable.

GoldsteinE avatar Jul 19 '22 15:07 GoldsteinE

I think this isn't quite right - only a small sunset of non-Copy types is permitted, and probably should be documented here.

Mark-Simulacrum avatar Jul 19 '22 15:07 Mark-Simulacrum

I thought any non-Copy types without custom destructors are allowed? I’m going to re-read that issue, thanks for correction.

GoldsteinE avatar Jul 19 '22 15:07 GoldsteinE

We recently changed the documentation for union drop requirements (#1238). I think it would be fine to keep some kind of note here, just as a reminder as to why derive(Copy) is included in the example. Perhaps it could be something like:

Note: Union fields are restricted to a certain subset of types, such as deriving Copy in this example. See Unions for more information.

Also, there are two identical notes in this chapter that need to be updated.

ehuss avatar Jul 19 '22 17:07 ehuss