Rollup merge of #22596 - alexcrichton:fix-some-impls, r=huonw
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.
This commit is contained in:
commit
7b7cf84975
12 changed files with 68 additions and 25 deletions
27
src/test/run-pass/std-sync-right-kind-impls.rs
Normal file
27
src/test/run-pass/std-sync-right-kind-impls.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::sync;
|
||||
|
||||
fn assert_both<T: Sync + Send>() {}
|
||||
|
||||
fn main() {
|
||||
assert_both::<sync::StaticMutex>();
|
||||
assert_both::<sync::StaticCondvar>();
|
||||
assert_both::<sync::StaticRwLock>();
|
||||
assert_both::<sync::Mutex<()>>();
|
||||
assert_both::<sync::Condvar>();
|
||||
assert_both::<sync::RwLock<()>>();
|
||||
assert_both::<sync::Semaphore>();
|
||||
assert_both::<sync::Barrier>();
|
||||
assert_both::<sync::Arc<()>>();
|
||||
assert_both::<sync::Weak<()>>();
|
||||
assert_both::<sync::Once>();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue