Skip to content

Commit

Permalink
Add suggestions from lcnr
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianKnodt committed Aug 7, 2020
1 parent 94ec272 commit 664e456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,11 @@ impl<T, const N: usize> [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<U>; 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() }
}
}

0 comments on commit 664e456

Please sign in to comment.