From 140e2d3a092ebbeea5e110222bea3b37bc49abb8 Mon Sep 17 00:00:00 2001 From: Lee Jeffery Date: Sun, 20 Sep 2015 11:35:08 +0100 Subject: Miscellaneous cleanup for old issues. --- src/libstd/sync/mutex.rs | 23 +++++++++++------------ src/libstd/sync/rwlock.rs | 23 +++++++++++------------ 2 files changed, 22 insertions(+), 24 deletions(-) (limited to 'src/libstd/sync') diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 846a97b547d..f1d264b38a0 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -536,16 +536,15 @@ mod tests { assert_eq!(*lock, 2); } - // FIXME(#25351) needs deeply nested coercions of DST structs. - // #[test] - // fn test_mutex_unsized() { - // let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]); - // { - // let b = &mut *mutex.lock().unwrap(); - // b[0] = 4; - // b[2] = 5; - // } - // let comp: &[i32] = &[4, 2, 5]; - // assert_eq!(&*mutex.lock().unwrap(), comp); - // } + #[test] + fn test_mutex_unsized() { + let mutex: &Mutex<[i32]> = &Mutex::new([1, 2, 3]); + { + let b = &mut *mutex.lock().unwrap(); + b[0] = 4; + b[2] = 5; + } + let comp: &[i32] = &[4, 2, 5]; + assert_eq!(&*mutex.lock().unwrap(), comp); + } } diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 7210328fad8..04ad4708246 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -578,18 +578,17 @@ mod tests { assert_eq!(*lock, 2); } - // FIXME(#25351) needs deeply nested coercions of DST structs. - // #[test] - // fn test_rwlock_unsized() { - // let rw: &RwLock<[i32]> = &RwLock::new([1, 2, 3]); - // { - // let b = &mut *rw.write().unwrap(); - // b[0] = 4; - // b[2] = 5; - // } - // let comp: &[i32] = &[4, 2, 5]; - // assert_eq!(&*rw.read().unwrap(), comp); - // } + #[test] + fn test_rwlock_unsized() { + let rw: &RwLock<[i32]> = &RwLock::new([1, 2, 3]); + { + let b = &mut *rw.write().unwrap(); + b[0] = 4; + b[2] = 5; + } + let comp: &[i32] = &[4, 2, 5]; + assert_eq!(&*rw.read().unwrap(), comp); + } #[test] fn test_rwlock_try_write() { -- cgit 1.4.1-3-g733a5