Skip to content

Commit fc82f3b

Browse files
committed
Shrink allocations to fit the type at hand
1 parent b4f78c0 commit fc82f3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ impl<'tcx> Const<'tcx> {
19861986
let mut bytes = [0_u8; 16];
19871987
let endian = tcx.data_layout.endian;
19881988
write_target_uint(endian, &mut bytes, bits).unwrap();
1989-
Self::from_bytes(tcx, &bytes, layout)
1989+
Self::from_bytes(tcx, &bytes[0..(layout.size.bytes() as usize)], layout)
19901990
}
19911991

19921992
#[inline]

0 commit comments

Comments
 (0)