Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7e2ffc7

Browse files
committedNov 17, 2015
Add missing annotations and some tests
1 parent 52acc05 commit 7e2ffc7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+439
-21
lines changed
 

‎src/liballoc/arc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,13 @@ pub struct Arc<T: ?Sized> {
130130
_ptr: Shared<ArcInner<T>>,
131131
}
132132

133+
#[stable(feature = "rust1", since = "1.0.0")]
133134
unsafe impl<T: ?Sized + Sync + Send> Send for Arc<T> { }
135+
#[stable(feature = "rust1", since = "1.0.0")]
134136
unsafe impl<T: ?Sized + Sync + Send> Sync for Arc<T> { }
135137

136138
#[cfg(not(stage0))] // remove cfg after new snapshot
139+
#[unstable(feature = "coerce_unsized", issue = "27732")]
137140
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
138141

139142
/// A weak pointer to an `Arc`.
@@ -148,10 +151,13 @@ pub struct Weak<T: ?Sized> {
148151
_ptr: Shared<ArcInner<T>>,
149152
}
150153

154+
#[stable(feature = "rust1", since = "1.0.0")]
151155
unsafe impl<T: ?Sized + Sync + Send> Send for Weak<T> { }
156+
#[stable(feature = "rust1", since = "1.0.0")]
152157
unsafe impl<T: ?Sized + Sync + Send> Sync for Weak<T> { }
153158

154159
#[cfg(not(stage0))] // remove cfg after new snapshot
160+
#[unstable(feature = "coerce_unsized", issue = "27732")]
155161
impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}
156162

157163
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1157,6 +1163,7 @@ mod tests {
11571163
}
11581164
}
11591165

1166+
#[stable(feature = "rust1", since = "1.0.0")]
11601167
impl<T: ?Sized> borrow::Borrow<T> for Arc<T> {
11611168
fn borrow(&self) -> &T {
11621169
&**self

‎src/liballoc/boxed.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ pub struct IntermediateBox<T: ?Sized> {
136136
marker: marker::PhantomData<*mut T>,
137137
}
138138

139+
#[unstable(feature = "placement_in",
140+
reason = "placement box design is still being worked out.",
141+
issue = "27779")]
139142
impl<T> Place<T> for IntermediateBox<T> {
140143
fn pointer(&mut self) -> *mut T {
141144
self.ptr as *mut T
@@ -170,19 +173,26 @@ fn make_place<T>() -> IntermediateBox<T> {
170173
}
171174
}
172175

176+
#[unstable(feature = "placement_in",
177+
reason = "placement box design is still being worked out.",
178+
issue = "27779")]
173179
impl<T> BoxPlace<T> for IntermediateBox<T> {
174180
fn make_place() -> IntermediateBox<T> {
175181
make_place()
176182
}
177183
}
178184

185+
#[unstable(feature = "placement_in",
186+
reason = "placement box design is still being worked out.",
187+
issue = "27779")]
179188
impl<T> InPlace<T> for IntermediateBox<T> {
180189
type Owner = Box<T>;
181190
unsafe fn finalize(self) -> Box<T> {
182191
finalize(self)
183192
}
184193
}
185194

195+
#[unstable(feature = "placement_new_protocol", issue = "27779")]
186196
impl<T> Boxed for Box<T> {
187197
type Data = T;
188198
type Place = IntermediateBox<T>;
@@ -191,6 +201,9 @@ impl<T> Boxed for Box<T> {
191201
}
192202
}
193203

204+
#[unstable(feature = "placement_in",
205+
reason = "placement box design is still being worked out.",
206+
issue = "27779")]
194207
impl<T> Placer<T> for ExchangeHeapSingleton {
195208
type Place = IntermediateBox<T>;
196209

@@ -199,6 +212,9 @@ impl<T> Placer<T> for ExchangeHeapSingleton {
199212
}
200213
}
201214

215+
#[unstable(feature = "placement_in",
216+
reason = "placement box design is still being worked out.",
217+
issue = "27779")]
202218
impl<T: ?Sized> Drop for IntermediateBox<T> {
203219
fn drop(&mut self) {
204220
if self.size > 0 {
@@ -518,6 +534,7 @@ pub trait FnBox<A> {
518534
fn call_box(self: Box<Self>, args: A) -> Self::Output;
519535
}
520536

537+
#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")]
521538
impl<A,F> FnBox<A> for F
522539
where F: FnOnce<A>
523540
{
@@ -528,6 +545,7 @@ impl<A,F> FnBox<A> for F
528545
}
529546
}
530547

548+
#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")]
531549
impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+'a> {
532550
type Output = R;
533551

@@ -536,6 +554,7 @@ impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+'a> {
536554
}
537555
}
538556

557+
#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")]
539558
impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+Send+'a> {
540559
type Output = R;
541560

@@ -544,6 +563,7 @@ impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+Send+'a> {
544563
}
545564
}
546565

566+
#[unstable(feature = "coerce_unsized", issue = "27732")]
547567
impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
548568

549569
#[stable(feature = "box_slice_clone", since = "1.3.0")]
@@ -597,12 +617,14 @@ impl<T: Clone> Clone for Box<[T]> {
597617
}
598618
}
599619

620+
#[stable(feature = "rust1", since = "1.0.0")]
600621
impl<T: ?Sized> borrow::Borrow<T> for Box<T> {
601622
fn borrow(&self) -> &T {
602623
&**self
603624
}
604625
}
605626

627+
#[stable(feature = "rust1", since = "1.0.0")]
606628
impl<T: ?Sized> borrow::BorrowMut<T> for Box<T> {
607629
fn borrow_mut(&mut self) -> &mut T {
608630
&mut **self

0 commit comments

Comments
 (0)
Please sign in to comment.