From 080fdb8184cea898f48818312a7645007c8b7594 Mon Sep 17 00:00:00 2001 From: Dodo Date: Wed, 28 Aug 2019 17:38:24 +0200 Subject: [PATCH] add missing `#[repr(C)]` on a union --- src/libcore/str/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index f20cb7bfbc3bd..752c372e93e3a 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -2170,6 +2170,7 @@ impl str { #[inline(always)] #[rustc_const_unstable(feature="const_str_as_bytes")] pub const fn as_bytes(&self) -> &[u8] { + #[repr(C)] union Slices<'a> { str: &'a str, slice: &'a [u8],