Skip to content

Commit f408d4b

Browse files
committed
use box->vec conversion API that doesn't reallocate
1 parent 83b01b9 commit f408d4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_middle/src/mir/interpret/allocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<Tag> Allocation<Tag> {
147147
})?;
148148
// SAFETY: This turns a Box<[MaybeUninit<u8>]> into a Vec<u8>. This is safe since the box
149149
// was zero-allocated which is a valid value for u8.
150-
let bytes = unsafe { bytes.assume_init().to_vec() };
150+
let bytes = unsafe { bytes.assume_init().into_vec() };
151151
Ok(Allocation {
152152
bytes,
153153
relocations: Relocations::new(),

0 commit comments

Comments
 (0)