Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #63980 - DutchGhost:master, r=cramertj
add missing `#[repr(C)]` on the Slices union Adds the `#[repr(C)]` attribute to the `Slices` union used to convert an `&str` into a `&[u8]`. Without the attribute, the union has an unspecified layout: https://doc.rust-lang.org/reference/types/union.html, so performing the 'transmute' is unsound without the attribute (as far as I understand). The `Repr` union, used for converting a raw ptr + len to a slice has this attribute as well: https://github.com/rust-lang/rust/blob/master/src/libcore/ptr/mod.rs#L211-#L216
- Loading branch information