diff options
| author | bors <bors@rust-lang.org> | 2020-07-02 08:35:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-07-02 08:35:53 +0000 |
| commit | b7856f695d65a8ebc846754f97d15814bcb1c244 (patch) | |
| tree | a30df4257643452b93662f454a9efa4b20e182b7 /src/libstd | |
| parent | 9491f18c5de3ff1c4bf9c3fdacf52d9859e26f7c (diff) | |
| parent | d7be1e4e3353c9f2bc9d697341905e93f57253b1 (diff) | |
| download | rust-b7856f695d65a8ebc846754f97d15814bcb1c244.tar.gz rust-b7856f695d65a8ebc846754f97d15814bcb1c244.zip | |
Auto merge of #73950 - Manishearth:rollup-0dtxnit, r=Manishearth
Rollup of 16 pull requests Successful merges: - #72569 (Remove legacy InnoSetup GUI installer) - #73306 (Don't implement Fn* traits for #[target_feature] functions) - #73345 (expand: Stop using nonterminals for passing tokens to attribute and derive macros) - #73449 (Provide more information on duplicate lang item error.) - #73569 (Handle `macro_rules!` tokens consistently across crates) - #73803 (Recover extra trailing angle brackets in struct definition) - #73839 (Split and expand nonstandard-style lints unicode unit test.) - #73841 (Remove defunct `-Z print-region-graph`) - #73848 (Fix markdown rendering in librustc_lexer docs) - #73865 (Fix Zulip topic format) - #73892 (Clean up E0712 explanation) - #73898 (remove duplicate test for #61935) - #73906 (Add missing backtick in `ty_error_with_message`) - #73909 (`#[deny(unsafe_op_in_unsafe_fn)]` in libstd/fs.rs) - #73910 (Rewrite a few manual index loops with while-let) - #73929 (Fix comment typo) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fs.rs | 7 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 17f890375f8..4d031cb7a52 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -8,6 +8,7 @@ //! extension traits of `std::os::$platform`. #![stable(feature = "rust1", since = "1.0.0")] +#![deny(unsafe_op_in_unsafe_fn)] use crate::ffi::OsString; use crate::fmt; @@ -666,7 +667,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")] @@ -711,7 +713,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")] diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 372038df54f..bd585d39c24 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -319,6 +319,7 @@ #![cfg_attr(bootstrap, feature(track_caller))] #![feature(try_reserve)] #![feature(unboxed_closures)] +#![feature(unsafe_block_in_unsafe_fn)] #![feature(untagged_unions)] #![feature(unwind_attributes)] #![feature(vec_into_raw_parts)] |
