Skip to content

Commit 73e27b3

Browse files
committed
deny(unsafe_op_in_unsafe_fn) in libstd/process.rs
1 parent a9025c5 commit 73e27b3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

library/std/src/process.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
//! [`Read`]: ../io/trait.Read.html
106106
107107
#![stable(feature = "process", since = "1.0.0")]
108+
#![deny(unsafe_op_in_unsafe_fn)]
108109

109110
use crate::io::prelude::*;
110111

@@ -311,7 +312,8 @@ impl Read for ChildStdout {
311312

312313
#[inline]
313314
unsafe fn initializer(&self) -> Initializer {
314-
Initializer::nop()
315+
// SAFETY: Read is guaranteed to work on uninitialized memory
316+
unsafe { Initializer::nop() }
315317
}
316318
}
317319

@@ -372,7 +374,8 @@ impl Read for ChildStderr {
372374

373375
#[inline]
374376
unsafe fn initializer(&self) -> Initializer {
375-
Initializer::nop()
377+
// SAFETY: Read is guaranteed to work on uninitialized memory
378+
unsafe { Initializer::nop() }
376379
}
377380
}
378381

0 commit comments

Comments
 (0)