]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sync/mutex.rs
Change error message in rustbook
[rust.git] / src / libstd / sync / mutex.rs
index 846a97b547dc6d09e8909a7330c898516c26e2cc..f1d264b38a0c7b18245cb46af66cfc66b351e6a5 100644 (file)
@@ -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);
+    }
 }