// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use prelude::v1::*;
-
use cell::UnsafeCell;
use fmt;
use marker;
#[stable(feature = "rw_lock_default", since = "1.9.0")]
impl<T: Default> Default for RwLock<T> {
+ /// Creates a new `RwLock<T>`, with the `Default` value for T.
fn default() -> RwLock<T> {
RwLock::new(Default::default())
}
mod tests {
#![allow(deprecated)] // rand
- use prelude::v1::*;
-
use rand::{self, Rng};
use sync::mpsc::channel;
use thread;
#[test]
fn test_rwlock_try_write() {
- use mem::drop;
-
let lock = RwLock::new(0isize);
let read_guard = lock.read().unwrap();