about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorP1start <rewi-github@whanau.org>2015-05-16 10:29:35 +1200
committerP1start <rewi-github@whanau.org>2015-05-16 11:01:52 +1200
commitfa28642de9fc158613f294896e62e12c3067714e (patch)
treec2a56ac6f2bb16d01de2a3a1a1fd40b5fe5af7ca /src/libcollections
parent716f920b7e234b450f272346fea961832505c06e (diff)
downloadrust-fa28642de9fc158613f294896e62e12c3067714e.tar.gz
rust-fa28642de9fc158613f294896e62e12c3067714e.zip
Allow `?Sized` types in `Rc`’s impls of {Partial,}{Ord,Eq} and Borrow
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/borrow.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcollections/borrow.rs b/src/libcollections/borrow.rs
index a86a4b4215f..08bd88cd861 100644
--- a/src/libcollections/borrow.rs
+++ b/src/libcollections/borrow.rs
@@ -116,10 +116,16 @@ impl<'a, T: ?Sized> BorrowMut<T> for &'a mut T {
     fn borrow_mut(&mut self) -> &mut T { &mut **self }
 }
 
+#[cfg(stage0)]
 impl<T> Borrow<T> for rc::Rc<T> {
     fn borrow(&self) -> &T { &**self }
 }
 
+#[cfg(not(stage0))]
+impl<T: ?Sized> Borrow<T> for rc::Rc<T> {
+    fn borrow(&self) -> &T { &**self }
+}
+
 impl<T> Borrow<T> for arc::Arc<T> {
     fn borrow(&self) -> &T { &**self }
 }