Skip to content

Commit

Permalink
#[deny(unsafe_op_in_unsafe_fn)] in libstd/fs.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
eltonlaw committed Jul 1, 2020
1 parent 16957bd commit 7616cd9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@ impl Read for File {

#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
// SAFETY: Read is guaranteed to work on uninitialized memory
unsafe { Initializer::nop() }
}
}
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -711,7 +712,8 @@ impl Read for &File {

#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
// SAFETY: Read is guaranteed to work on uninitialized memory
unsafe { Initializer::nop() }
}
}
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit 7616cd9

Please sign in to comment.