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);
+ }
}