From 664e456e2596042d9bf482991a71106f8ffe5ee9 Mon Sep 17 00:00:00 2001 From: kadmin Date: Fri, 7 Aug 2020 05:36:35 +0000 Subject: [PATCH] Add suggestions from lcnr --- library/core/src/array/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index eba7c6fb2d707..16baef137cbe2 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -407,11 +407,11 @@ impl [T; N] { dst.write(f(src)); guard.initialized += 1; } - // FIXME convert to crate::mem::transmute when works with generics + // FIXME: Convert to crate::mem::transmute once it works with generics. // unsafe { crate::mem::transmute::<[MaybeUninit; N], [U; N]>(dst) } crate::mem::forget(guard); // SAFETY: At this point we've properly initialized the whole array - // and we just need to cast it to the correct type + // and we just need to cast it to the correct type. unsafe { (&mut dst as *mut _ as *mut [U; N]).read() } } }