diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-11-16 19:54:28 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-11-18 01:24:21 +0300 |
| commit | 7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2 (patch) | |
| tree | 63f67955eac7b8d88a7a771a958948500d4d9f15 /src/liballoc | |
| parent | 52acc05f6398d70e8cc506e19bb9fefbed7368ac (diff) | |
| download | rust-7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2.tar.gz rust-7e2ffc7090a70fe8c77a0e03fcec3cb1387141f2.zip | |
Add missing annotations and some tests
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 7 | ||||
| -rw-r--r-- | src/liballoc/boxed.rs | 22 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 7 |
3 files changed, 36 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 8205e13205f..7863f101811 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -130,10 +130,13 @@ pub struct Arc<T: ?Sized> { _ptr: Shared<ArcInner<T>>, } +#[stable(feature = "rust1", since = "1.0.0")] unsafe impl<T: ?Sized + Sync + Send> Send for Arc<T> { } +#[stable(feature = "rust1", since = "1.0.0")] unsafe impl<T: ?Sized + Sync + Send> Sync for Arc<T> { } #[cfg(not(stage0))] // remove cfg after new snapshot +#[unstable(feature = "coerce_unsized", issue = "27732")] impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {} /// A weak pointer to an `Arc`. @@ -148,10 +151,13 @@ pub struct Weak<T: ?Sized> { _ptr: Shared<ArcInner<T>>, } +#[stable(feature = "rust1", since = "1.0.0")] unsafe impl<T: ?Sized + Sync + Send> Send for Weak<T> { } +#[stable(feature = "rust1", since = "1.0.0")] unsafe impl<T: ?Sized + Sync + Send> Sync for Weak<T> { } #[cfg(not(stage0))] // remove cfg after new snapshot +#[unstable(feature = "coerce_unsized", issue = "27732")] impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {} #[stable(feature = "rust1", since = "1.0.0")] @@ -1157,6 +1163,7 @@ mod tests { } } +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> borrow::Borrow<T> for Arc<T> { fn borrow(&self) -> &T { &**self diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index b5c6cdff119..65c66ebe768 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -136,6 +136,9 @@ pub struct IntermediateBox<T: ?Sized> { marker: marker::PhantomData<*mut T>, } +#[unstable(feature = "placement_in", + reason = "placement box design is still being worked out.", + issue = "27779")] impl<T> Place<T> for IntermediateBox<T> { fn pointer(&mut self) -> *mut T { self.ptr as *mut T @@ -170,12 +173,18 @@ fn make_place<T>() -> IntermediateBox<T> { } } +#[unstable(feature = "placement_in", + reason = "placement box design is still being worked out.", + issue = "27779")] impl<T> BoxPlace<T> for IntermediateBox<T> { fn make_place() -> IntermediateBox<T> { make_place() } } +#[unstable(feature = "placement_in", + reason = "placement box design is still being worked out.", + issue = "27779")] impl<T> InPlace<T> for IntermediateBox<T> { type Owner = Box<T>; unsafe fn finalize(self) -> Box<T> { @@ -183,6 +192,7 @@ impl<T> InPlace<T> for IntermediateBox<T> { } } +#[unstable(feature = "placement_new_protocol", issue = "27779")] impl<T> Boxed for Box<T> { type Data = T; type Place = IntermediateBox<T>; @@ -191,6 +201,9 @@ impl<T> Boxed for Box<T> { } } +#[unstable(feature = "placement_in", + reason = "placement box design is still being worked out.", + issue = "27779")] impl<T> Placer<T> for ExchangeHeapSingleton { type Place = IntermediateBox<T>; @@ -199,6 +212,9 @@ impl<T> Placer<T> for ExchangeHeapSingleton { } } +#[unstable(feature = "placement_in", + reason = "placement box design is still being worked out.", + issue = "27779")] impl<T: ?Sized> Drop for IntermediateBox<T> { fn drop(&mut self) { if self.size > 0 { @@ -518,6 +534,7 @@ pub trait FnBox<A> { fn call_box(self: Box<Self>, args: A) -> Self::Output; } +#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")] impl<A,F> FnBox<A> for F where F: FnOnce<A> { @@ -528,6 +545,7 @@ impl<A,F> FnBox<A> for F } } +#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")] impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+'a> { type Output = R; @@ -536,6 +554,7 @@ impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+'a> { } } +#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")] impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+Send+'a> { type Output = R; @@ -544,6 +563,7 @@ impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+Send+'a> { } } +#[unstable(feature = "coerce_unsized", issue = "27732")] impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {} #[stable(feature = "box_slice_clone", since = "1.3.0")] @@ -597,12 +617,14 @@ impl<T: Clone> Clone for Box<[T]> { } } +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> borrow::Borrow<T> for Box<T> { fn borrow(&self) -> &T { &**self } } +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> borrow::BorrowMut<T> for Box<T> { fn borrow_mut(&mut self) -> &mut T { &mut **self diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 88db3cfe4b6..7abdc447ee5 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -191,10 +191,13 @@ pub struct Rc<T: ?Sized> { _ptr: Shared<RcBox<T>>, } +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> !marker::Send for Rc<T> {} +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> !marker::Sync for Rc<T> {} #[cfg(not(stage0))] // remove cfg after new snapshot +#[unstable(feature = "coerce_unsized", issue = "27732")] impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Rc<U>> for Rc<T> {} impl<T> Rc<T> { @@ -723,10 +726,13 @@ pub struct Weak<T: ?Sized> { _ptr: Shared<RcBox<T>>, } +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> !marker::Send for Weak<T> {} +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> !marker::Sync for Weak<T> {} #[cfg(not(stage0))] // remove cfg after new snapshot +#[unstable(feature = "coerce_unsized", issue = "27732")] impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {} impl<T: ?Sized> Weak<T> { @@ -1126,6 +1132,7 @@ mod tests { } } +#[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized> borrow::Borrow<T> for Rc<T> { fn borrow(&self) -> &T { &**self |
