From 73e27b3e18dcbbef3a36620c4a44306e2bbdcd13 Mon Sep 17 00:00:00 2001 From: Marcel Hellwig Date: Thu, 2 Jul 2020 09:16:04 +0200 Subject: [PATCH] deny(unsafe_op_in_unsafe_fn) in libstd/process.rs --- library/std/src/process.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 4ba1940fd0e..9048d93cbbf 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -105,6 +105,7 @@ //! [`Read`]: ../io/trait.Read.html #![stable(feature = "process", since = "1.0.0")] +#![deny(unsafe_op_in_unsafe_fn)] use crate::io::prelude::*; @@ -311,7 +312,8 @@ impl Read for ChildStdout { #[inline] unsafe fn initializer(&self) -> Initializer { - Initializer::nop() + // SAFETY: Read is guaranteed to work on uninitialized memory + unsafe { Initializer::nop() } } } @@ -372,7 +374,8 @@ impl Read for ChildStderr { #[inline] unsafe fn initializer(&self) -> Initializer { - Initializer::nop() + // SAFETY: Read is guaranteed to work on uninitialized memory + unsafe { Initializer::nop() } } }