about summary refs log tree commit diff
path: root/src/libcore/nonzero.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-05-13 06:43:05 +0000
committerbors <bors@rust-lang.org>2015-05-13 06:43:05 +0000
commitfa433875274ff4a7c4cab7d87c1284ba782ef643 (patch)
treed8e0dada660d0606983ad1f3efc4761f4b515489 /src/libcore/nonzero.rs
parent30a42faa1c42ce5988241d3af993921246954b1a (diff)
parentb799cd83cc797b580be2d1492e6ae014848636ee (diff)
downloadrust-fa433875274ff4a7c4cab7d87c1284ba782ef643.tar.gz
rust-fa433875274ff4a7c4cab7d87c1284ba782ef643.zip
Auto merge of #24619 - nrc:rc-coerce, r=nikomatsakis
r? @nikomatsakis (note a few TODOs left in the code where I wasn't sure about stuff).
Diffstat (limited to 'src/libcore/nonzero.rs')
-rw-r--r--src/libcore/nonzero.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs
index 13b6468105d..59819fd500d 100644
--- a/src/libcore/nonzero.rs
+++ b/src/libcore/nonzero.rs
@@ -12,6 +12,8 @@
 
 use marker::Sized;
 use ops::Deref;
+#[cfg(not(stage0))]
+use ops::CoerceUnsized;
 
 /// Unsafe trait to indicate what types are usable with the NonZero struct
 pub unsafe trait Zeroable {}
@@ -54,3 +56,6 @@ impl<T: Zeroable> Deref for NonZero<T> {
         inner
     }
 }
+
+#[cfg(not(stage0))]
+impl<T: Zeroable+CoerceUnsized<U>, U: Zeroable> CoerceUnsized<NonZero<U>> for NonZero<T> {}