Skip to content

Commit 7e2ffc7

Browse files
committed
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

+7
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

+22
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

src/liballoc/rc.rs

+7
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,13 @@ pub struct Rc<T: ?Sized> {
191191
_ptr: Shared<RcBox<T>>,
192192
}
193193

194+
#[stable(feature = "rust1", since = "1.0.0")]
194195
impl<T: ?Sized> !marker::Send for Rc<T> {}
196+
#[stable(feature = "rust1", since = "1.0.0")]
195197
impl<T: ?Sized> !marker::Sync for Rc<T> {}
196198

197199
#[cfg(not(stage0))] // remove cfg after new snapshot
200+
#[unstable(feature = "coerce_unsized", issue = "27732")]
198201
impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Rc<U>> for Rc<T> {}
199202

200203
impl<T> Rc<T> {
@@ -723,10 +726,13 @@ pub struct Weak<T: ?Sized> {
723726
_ptr: Shared<RcBox<T>>,
724727
}
725728

729+
#[stable(feature = "rust1", since = "1.0.0")]
726730
impl<T: ?Sized> !marker::Send for Weak<T> {}
731+
#[stable(feature = "rust1", since = "1.0.0")]
727732
impl<T: ?Sized> !marker::Sync for Weak<T> {}
728733

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

732738
impl<T: ?Sized> Weak<T> {
@@ -1126,6 +1132,7 @@ mod tests {
11261132
}
11271133
}
11281134

1135+
#[stable(feature = "rust1", since = "1.0.0")]
11291136
impl<T: ?Sized> borrow::Borrow<T> for Rc<T> {
11301137
fn borrow(&self) -> &T {
11311138
&**self

src/libcollections/binary_heap.rs

+2
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ impl<'a, T: 'a> DoubleEndedIterator for Drain<'a, T> {
731731
#[stable(feature = "rust1", since = "1.0.0")]
732732
impl<'a, T: 'a> ExactSizeIterator for Drain<'a, T> {}
733733

734+
#[stable(feature = "rust1", since = "1.0.0")]
734735
impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
735736
fn from(vec: Vec<T>) -> BinaryHeap<T> {
736737
let mut heap = BinaryHeap { data: vec };
@@ -743,6 +744,7 @@ impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
743744
}
744745
}
745746

747+
#[stable(feature = "rust1", since = "1.0.0")]
746748
impl<T> From<BinaryHeap<T>> for Vec<T> {
747749
fn from(heap: BinaryHeap<T>) -> Vec<T> {
748750
heap.data

src/libcollections/borrow.rs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use fmt;
2424

2525
use self::Cow::*;
2626

27+
#[stable(feature = "rust1", since = "1.0.0")]
2728
pub use core::borrow::{Borrow, BorrowMut};
2829

2930
#[stable(feature = "rust1", since = "1.0.0")]

src/libcollections/btree/node.rs

-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ impl<K, V> Node<K, V> {
451451
}
452452

453453
// FIXME(gereeter) Write an efficient clone_from
454-
#[stable(feature = "rust1", since = "1.0.0")]
455454
impl<K: Clone, V: Clone> Clone for Node<K, V> {
456455
fn clone(&self) -> Node<K, V> {
457456
let mut ret = if self.is_leaf() {

src/libcollections/fmt.rs

+8
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,21 @@
475475
476476
#![stable(feature = "rust1", since = "1.0.0")]
477477

478+
#[stable(feature = "rust1", since = "1.0.0")]
478479
pub use core::fmt::{Formatter, Result, Write, rt};
480+
#[stable(feature = "rust1", since = "1.0.0")]
479481
pub use core::fmt::{Octal, Binary};
482+
#[stable(feature = "rust1", since = "1.0.0")]
480483
pub use core::fmt::{Display, Debug};
484+
#[stable(feature = "rust1", since = "1.0.0")]
481485
pub use core::fmt::{LowerHex, UpperHex, Pointer};
486+
#[stable(feature = "rust1", since = "1.0.0")]
482487
pub use core::fmt::{LowerExp, UpperExp};
488+
#[stable(feature = "rust1", since = "1.0.0")]
483489
pub use core::fmt::Error;
490+
#[stable(feature = "rust1", since = "1.0.0")]
484491
pub use core::fmt::{ArgumentV1, Arguments, write, radix, Radix, RadixFmt};
492+
#[stable(feature = "rust1", since = "1.0.0")]
485493
pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
486494

487495
use string;

src/libcollections/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ pub mod vec_deque;
107107

108108
#[stable(feature = "rust1", since = "1.0.0")]
109109
pub mod btree_map {
110+
#[stable(feature = "rust1", since = "1.0.0")]
110111
pub use btree::map::*;
111112
}
112113

113114
#[stable(feature = "rust1", since = "1.0.0")]
114115
pub mod btree_set {
116+
#[stable(feature = "rust1", since = "1.0.0")]
115117
pub use btree::set::*;
116118
}
117119

src/libcollections/linked_list.rs

+2
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ impl<A> DoubleEndedIterator for IntoIter<A> {
857857
fn next_back(&mut self) -> Option<A> { self.list.pop_back() }
858858
}
859859

860+
#[stable(feature = "rust1", since = "1.0.0")]
860861
impl<A> ExactSizeIterator for IntoIter<A> {}
861862

862863
#[stable(feature = "rust1", since = "1.0.0")]
@@ -890,6 +891,7 @@ impl<'a, T> IntoIterator for &'a LinkedList<T> {
890891
}
891892
}
892893

894+
#[stable(feature = "rust1", since = "1.0.0")]
893895
impl<'a, T> IntoIterator for &'a mut LinkedList<T> {
894896
type Item = &'a mut T;
895897
type IntoIter = IterMut<'a, T>;

src/libcollections/slice.rs

+9
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,18 @@ use core::slice as core_slice;
102102
use borrow::{Borrow, BorrowMut, ToOwned};
103103
use vec::Vec;
104104

105+
#[stable(feature = "rust1", since = "1.0.0")]
105106
pub use core::slice::{Chunks, Windows};
107+
#[stable(feature = "rust1", since = "1.0.0")]
106108
pub use core::slice::{Iter, IterMut};
109+
#[stable(feature = "rust1", since = "1.0.0")]
107110
pub use core::slice::{SplitMut, ChunksMut, Split};
111+
#[stable(feature = "rust1", since = "1.0.0")]
108112
pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut};
113+
#[unstable(feature = "ref_slice", issue = "27774")]
109114
#[allow(deprecated)]
110115
pub use core::slice::{bytes, mut_ref_slice, ref_slice};
116+
#[stable(feature = "rust1", since = "1.0.0")]
111117
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
112118

113119
////////////////////////////////////////////////////////////////////////////////
@@ -860,6 +866,9 @@ pub trait SliceConcatExt<T: ?Sized> {
860866
fn connect(&self, sep: &T) -> Self::Output;
861867
}
862868

869+
#[unstable(feature = "slice_concat_ext",
870+
reason = "trait should not have to exist",
871+
issue = "27747")]
863872
impl<T: Clone, V: Borrow<[T]>> SliceConcatExt<T> for [V] {
864873
type Output = Vec<T>;
865874

src/libcollections/str.rs

+14
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,33 @@ use vec::Vec;
3737
use slice::SliceConcatExt;
3838
use boxed::Box;
3939

40+
#[stable(feature = "rust1", since = "1.0.0")]
4041
pub use core::str::{FromStr, Utf8Error};
4142
#[allow(deprecated)]
43+
#[stable(feature = "rust1", since = "1.0.0")]
4244
pub use core::str::{Lines, LinesAny, CharRange};
45+
#[stable(feature = "rust1", since = "1.0.0")]
4346
pub use core::str::{Split, RSplit};
47+
#[stable(feature = "rust1", since = "1.0.0")]
4448
pub use core::str::{SplitN, RSplitN};
49+
#[stable(feature = "rust1", since = "1.0.0")]
4550
pub use core::str::{SplitTerminator, RSplitTerminator};
51+
#[stable(feature = "rust1", since = "1.0.0")]
4652
pub use core::str::{Matches, RMatches};
53+
#[stable(feature = "rust1", since = "1.0.0")]
4754
pub use core::str::{MatchIndices, RMatchIndices};
55+
#[stable(feature = "rust1", since = "1.0.0")]
4856
pub use core::str::{from_utf8, Chars, CharIndices, Bytes};
57+
#[stable(feature = "rust1", since = "1.0.0")]
4958
pub use core::str::{from_utf8_unchecked, ParseBoolError};
59+
#[stable(feature = "rust1", since = "1.0.0")]
5060
pub use rustc_unicode::str::{SplitWhitespace};
61+
#[stable(feature = "rust1", since = "1.0.0")]
5162
pub use core::str::pattern;
5263

64+
#[unstable(feature = "slice_concat_ext",
65+
reason = "trait should not have to exist",
66+
issue = "27747")]
5367
impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
5468
type Output = String;
5569

src/libcollections/string.rs

+9
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,9 @@ impl Extend<String> for String {
949949
}
950950

951951
/// A convenience impl that delegates to the impl for `&str`
952+
#[unstable(feature = "pattern",
953+
reason = "API not fully fleshed out and ready to be stabilized",
954+
issue = "27721")]
952955
impl<'a, 'b> Pattern<'a> for &'b String {
953956
type Searcher = <&'b str as Pattern<'a>>::Searcher;
954957

@@ -1143,24 +1146,28 @@ impl FromStr for String {
11431146
}
11441147
}
11451148

1149+
#[stable(feature = "str_parse_error", since = "1.5.0")]
11461150
impl Clone for ParseError {
11471151
fn clone(&self) -> ParseError {
11481152
match *self {}
11491153
}
11501154
}
11511155

1156+
#[stable(feature = "str_parse_error", since = "1.5.0")]
11521157
impl fmt::Debug for ParseError {
11531158
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
11541159
match *self {}
11551160
}
11561161
}
11571162

1163+
#[stable(feature = "str_parse_error", since = "1.5.0")]
11581164
impl PartialEq for ParseError {
11591165
fn eq(&self, _: &ParseError) -> bool {
11601166
match *self {}
11611167
}
11621168
}
11631169

1170+
#[stable(feature = "str_parse_error", since = "1.5.0")]
11641171
impl Eq for ParseError {}
11651172

11661173
/// A generic trait for converting a value to a string
@@ -1287,7 +1294,9 @@ pub struct Drain<'a> {
12871294
iter: Chars<'a>,
12881295
}
12891296

1297+
#[unstable(feature = "drain", reason = "recently added", issue = "27711")]
12901298
unsafe impl<'a> Sync for Drain<'a> {}
1299+
#[unstable(feature = "drain", reason = "recently added", issue = "27711")]
12911300
unsafe impl<'a> Send for Drain<'a> {}
12921301

12931302
#[unstable(feature = "drain", reason = "recently added", issue = "27711")]

0 commit comments

Comments
 (0)