about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-29 05:32:58 +0200
committerGitHub <noreply@github.com>2019-08-29 05:32:58 +0200
commit73910092365b67fa897bc828b7a4ffa1f2c776cf (patch)
tree5c5f821faca76cb44f2cc891746a1cbff1f2fa4b /src/libsyntax/parse
parente3028dbda8bf32495efe78f268461ff489bb905d (diff)
parent080fdb8184cea898f48818312a7645007c8b7594 (diff)
downloadrust-73910092365b67fa897bc828b7a4ffa1f2c776cf.tar.gz
rust-73910092365b67fa897bc828b7a4ffa1f2c776cf.zip
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
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions