X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibstd%2Fsync%2Fmutex.rs;h=f1d264b38a0c7b18245cb46af66cfc66b351e6a5;hb=a3f9fc69d6e9fe3e3c3fd0f1e69ddd9733a2e05b;hp=846a97b547dc6d09e8909a7330c898516c26e2cc;hpb=4fc09d3a15d18ee15897fa90ad93dc2cef37c919;p=rust.git 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 @@ fn drop(&mut self) { 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); + } }