diff --git a/framework/base/src/types/managed/wrapped/managed_vec.rs b/framework/base/src/types/managed/wrapped/managed_vec.rs index 0b32d308e1..5692a5f090 100644 --- a/framework/base/src/types/managed/wrapped/managed_vec.rs +++ b/framework/base/src/types/managed/wrapped/managed_vec.rs @@ -171,7 +171,10 @@ where unsafe { MaybeUninit::<[MaybeUninit>; N]>::uninit().assume_init() }; for (index, value) in self.iter().enumerate() { - result_uninit[index].write(value); + // length already checked + unsafe { + result_uninit.get_unchecked_mut(index).write(value); + } } let result = unsafe { transmute_copy(&ManuallyDrop::new(result_uninit)) };