diff options
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 4 | ||||
| -rw-r--r-- | src/liballoc/boxed.rs | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 893c9d250b7..e060ecad974 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -129,6 +129,10 @@ pub struct Weak<T> { _ptr: *mut ArcInner<T>, } +impl<T: Sync + Send> Send for Arc<T> { } + +impl<T: Sync + Send> Sync for Arc<T> { } + struct ArcInner<T> { strong: atomic::AtomicUint, weak: atomic::AtomicUint, diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 5fd234192c5..0f81d43356d 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -19,6 +19,7 @@ use core::hash::{mod, Hash}; use core::kinds::Sized; use core::mem; use core::option::Option; +use core::ptr::OwnedPtr; use core::raw::TraitObject; use core::result::Result; use core::result::Result::{Ok, Err}; @@ -44,7 +45,7 @@ pub static HEAP: () = (); /// A type that represents a uniquely-owned value. #[lang = "owned_box"] #[unstable = "custom allocators will add an additional type parameter (with default)"] -pub struct Box<T>(*mut T); +pub struct Box<T>(OwnedPtr<T>); #[stable] impl<T: Default> Default for Box<T> { |
