about summary refs log tree commit diff
path: root/src/libcoretest/ptr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-10 19:52:04 +0000
committerbors <bors@rust-lang.org>2015-02-10 19:52:04 +0000
commitbc87efef2cceaec99d30e809cac2b8d22b9e25fc (patch)
tree1f59e50bc58a426615cc15594cade8b69f24bdbf /src/libcoretest/ptr.rs
parent88d8ba5ab3b1d22288b021708c3d87464e43b880 (diff)
parent3e10785e21b731d536cf9ad9b911e8261862bde7 (diff)
downloadrust-bc87efef2cceaec99d30e809cac2b8d22b9e25fc.tar.gz
rust-bc87efef2cceaec99d30e809cac2b8d22b9e25fc.zip
Auto merge of #22153 - alexcrichton:rollup, r=alexcrichton
Diffstat (limited to 'src/libcoretest/ptr.rs')
-rw-r--r--src/libcoretest/ptr.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libcoretest/ptr.rs b/src/libcoretest/ptr.rs
index 7f0b97c53d4..2365b907b3f 100644
--- a/src/libcoretest/ptr.rs
+++ b/src/libcoretest/ptr.rs
@@ -167,3 +167,12 @@ fn test_set_memory() {
     unsafe { set_memory(ptr, 5u8, xs.len()); }
     assert!(xs == [5u8; 20]);
 }
+
+#[test]
+fn test_unsized_unique() {
+    let xs: &mut [_] = &mut [1, 2, 3];
+    let ptr = Unique(xs as *mut [_]);
+    let ys = unsafe { &mut *ptr.0 };
+    let zs: &mut [_] = &mut [1, 2, 3];
+    assert!(ys == zs);
+}