Open

Description
While revealing that dead Vec<_>
writes always emit, to someone else, I decided to look into this for arrays.
It seems that, for any [T; N]
, such that T is not a ZST or enum with a single possible value, and 3 <= N, then array writes are always emit. This applies to allowing emitting redundant memcpys, memclrs, memfills, and all related operations.
https://rust.godbolt.org/z/7vrT5xnxq
As for Vec<T>
, as long as T isn't as described above, then unobservable writes and operations are usually emit.
https://rust.godbolt.org/z/jhM75Mj5E