diff --git a/compiler/rustc_middle/src/mir/interpret/allocation.rs b/compiler/rustc_middle/src/mir/interpret/allocation.rs index a503c86c59b0e..ada6e09776694 100644 --- a/compiler/rustc_middle/src/mir/interpret/allocation.rs +++ b/compiler/rustc_middle/src/mir/interpret/allocation.rs @@ -147,7 +147,7 @@ impl Allocation { })?; // SAFETY: This turns a Box<[MaybeUninit]> into a Vec. This is safe since the box // was zero-allocated which is a valid value for u8. - let bytes = unsafe { bytes.assume_init().to_vec() }; + let bytes = unsafe { bytes.assume_init().into_vec() }; Ok(Allocation { bytes, relocations: Relocations::new(),