Skip to content

Commit 080fdb8

Browse files
committed
add missing #[repr(C)] on a union
1 parent ac21131 commit 080fdb8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcore/str/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2170,6 +2170,7 @@ impl str {
21702170
#[inline(always)]
21712171
#[rustc_const_unstable(feature="const_str_as_bytes")]
21722172
pub const fn as_bytes(&self) -> &[u8] {
2173+
#[repr(C)]
21732174
union Slices<'a> {
21742175
str: &'a str,
21752176
slice: &'a [u8],

0 commit comments

Comments
 (0)