Skip to content

Commit

Permalink
deny(unsafe_op_in_unsafe_fn) in libstd/process.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
hellow554 committed Aug 11, 2020
1 parent a9025c5 commit 73e27b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/std/src/process.rs
Expand Up @@ -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::*;

Expand Down Expand Up @@ -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() }
}
}

Expand Down Expand Up @@ -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() }
}
}

Expand Down

0 comments on commit 73e27b3

Please sign in to comment.