未验证 提交 1ac1f24d 编写于 作者: M Matthias Krüger 提交者: GitHub

Rollup merge of #92050 - r00ster91:patch-5, r=camelid

Add a space and 2 grave accents

I only noticed this because I have this implementation copy pasted in some places in my code and I really can't wait for this to be stabilized...
...@@ -972,8 +972,8 @@ pub unsafe fn assume_init_drop(&mut self) { ...@@ -972,8 +972,8 @@ pub unsafe fn assume_init_drop(&mut self) {
#[rustc_const_unstable(feature = "maybe_uninit_slice", issue = "63569")] #[rustc_const_unstable(feature = "maybe_uninit_slice", issue = "63569")]
#[inline(always)] #[inline(always)]
pub const unsafe fn slice_assume_init_ref(slice: &[Self]) -> &[T] { pub const unsafe fn slice_assume_init_ref(slice: &[Self]) -> &[T] {
// SAFETY: casting slice to a `*const [T]` is safe since the caller guarantees that // SAFETY: casting `slice` to a `*const [T]` is safe since the caller guarantees that
// `slice` is initialized, and`MaybeUninit` is guaranteed to have the same layout as `T`. // `slice` is initialized, and `MaybeUninit` is guaranteed to have the same layout as `T`.
// The pointer obtained is valid since it refers to memory owned by `slice` which is a // The pointer obtained is valid since it refers to memory owned by `slice` which is a
// reference and thus guaranteed to be valid for reads. // reference and thus guaranteed to be valid for reads.
unsafe { &*(slice as *const [Self] as *const [T]) } unsafe { &*(slice as *const [Self] as *const [T]) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册