diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-20 12:00:26 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-20 12:01:08 -0800 |
| commit | 64fe93e49dc0c6a552c5f08507064f2ce12800ca (patch) | |
| tree | 47b42afb310006fea769a9f02daf236651b55f5c /src/libstd/sync/once.rs | |
| parent | 522d09dfecbeca1595f25ac58c6d0178bbd21d7d (diff) | |
| download | rust-64fe93e49dc0c6a552c5f08507064f2ce12800ca.tar.gz rust-64fe93e49dc0c6a552c5f08507064f2ce12800ca.zip | |
std: Tidy up some `unsafe impl`s for `sync`
This commit removes many unnecessary `unsafe impl` blocks as well as pushing the needed implementations to the lowest level possible. I noticed that the bounds for `RwLock` are a little off when reviewing #22574 and wanted to ensure that we had our story straight on these implementations.
Diffstat (limited to 'src/libstd/sync/once.rs')
| -rw-r--r-- | src/libstd/sync/once.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 97f985e21e8..d2054a1e819 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -13,10 +13,9 @@ //! This primitive is meant to be used to run one-time initialization. An //! example use case would be for initializing an FFI library. +use prelude::v1::*; + use isize; -use marker::Sync; -use mem::drop; -use ops::FnOnce; use sync::atomic::{AtomicIsize, Ordering, ATOMIC_ISIZE_INIT}; use sync::{StaticMutex, MUTEX_INIT}; @@ -43,8 +42,6 @@ pub struct Once { lock_cnt: AtomicIsize, } -unsafe impl Sync for Once {} - /// Initialization value for static `Once` values. #[stable(feature = "rust1", since = "1.0.0")] pub const ONCE_INIT: Once = Once { |
