about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-30 12:03:19 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-30 12:03:19 -0800
commit0ba812fbf00e3026b29282e1a72d58ea7959833e (patch)
tree9c2f0c927b1e2c8168838a68a94928e087463e4a /src
parent692a3661fb731f70b1c72e527635c10219ed00e3 (diff)
parent83f8088108053efd2079d8ba8d677577685e8f6f (diff)
downloadrust-0ba812fbf00e3026b29282e1a72d58ea7959833e.tar.gz
rust-0ba812fbf00e3026b29282e1a72d58ea7959833e.zip
rollup merge of #21706: reem/missing-zeroable-impl-for-unique
This allows the use of `NonZero<Unique<T>>` for owned,
non-null raw pointers.

cc https://github.com/Gankro/collect-rs/pull/103
Diffstat (limited to 'src')
-rw-r--r--src/libcore/nonzero.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs
index 9ccea3b0739..3f83302742c 100644
--- a/src/libcore/nonzero.rs
+++ b/src/libcore/nonzero.rs
@@ -11,12 +11,14 @@
 //! Exposes the NonZero lang item which provides optimization hints.
 
 use ops::Deref;
+use ptr::Unique;
 
 /// Unsafe trait to indicate what types are usable with the NonZero struct
 pub unsafe trait Zeroable {}
 
 unsafe impl<T> Zeroable for *const T {}
 unsafe impl<T> Zeroable for *mut T {}
+unsafe impl<T> Zeroable for Unique<T> { }
 unsafe impl Zeroable for int {}
 unsafe impl Zeroable for uint {}
 unsafe impl Zeroable for i8 {}