about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2015-04-15 11:57:29 +1200
committerNick Cameron <ncameron@mozilla.com>2015-05-13 14:19:51 +1200
commit843db01bd925279da0a56efde532c9e3ecf73610 (patch)
treeeed89761dcb0ddeb578ca24357ef680787eabb43 /src/liballoc
parentc2b30b86df6b34ba19e87e63402e43d9e81a64fb (diff)
downloadrust-843db01bd925279da0a56efde532c9e3ecf73610.tar.gz
rust-843db01bd925279da0a56efde532c9e3ecf73610.zip
eddyb's changes for DST coercions
+ lots of rebasing
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/boxed.rs8
-rw-r--r--src/liballoc/rc.rs4
2 files changed, 10 insertions, 2 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index a0d60be3000..757c799d85c 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -62,6 +62,11 @@ use core::ops::{Deref, DerefMut};
 use core::ptr::{Unique};
 use core::raw::{TraitObject};
 
+#[cfg(not(stage0))] // SNAP c64d671
+use core::marker::Unsize;
+#[cfg(not(stage0))] // SNAP c64d671
+use core::ops::CoerceUnsized;
+
 /// A value that represents the heap. This is the default place that the `box`
 /// keyword allocates into when no place is supplied.
 ///
@@ -390,3 +395,6 @@ impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+Send+'a> {
         self.call_box(args)
     }
 }
+
+#[cfg(not(stage0))] // SNAP c64d671
+impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 015d0330ed7..a1b5e6e6baf 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -173,9 +173,9 @@ use core::intrinsics::assume;
 use heap::deallocate;
 
 struct RcBox<T> {
-    value: T,
     strong: Cell<usize>,
-    weak: Cell<usize>
+    weak: Cell<usize>,
+    value: T
 }
 
 /// A reference-counted pointer type over an immutable value.