Skip to content

Commit ce825f3

Browse files
committed
Add 'feature' and 'since' to stability attributes
1 parent 90aa581 commit ce825f3

File tree

186 files changed

+2822
-2561
lines changed

Some content is hidden

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

186 files changed

+2822
-2561
lines changed

src/liballoc/arc.rs

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![stable]
11+
#![stable(feature = "grandfathered", since = "1.0.0")]
1212

1313
//! Threadsafe reference-counted boxes (the `Arc<T>` type).
1414
//!
@@ -110,7 +110,7 @@ use heap::deallocate;
110110
/// }
111111
/// ```
112112
#[unsafe_no_drop_flag]
113-
#[stable]
113+
#[stable(feature = "grandfathered", since = "1.0.0")]
114114
pub struct Arc<T> {
115115
// FIXME #12808: strange name to try to avoid interfering with
116116
// field accesses of the contained type via Deref
@@ -126,7 +126,8 @@ unsafe impl<T: Sync + Send> Sync for Arc<T> { }
126126
/// Weak pointers will not keep the data inside of the `Arc` alive, and can be used to break cycles
127127
/// between `Arc` pointers.
128128
#[unsafe_no_drop_flag]
129-
#[unstable = "Weak pointers may not belong in this module."]
129+
#[unstable(feature = "unnamed_feature", since = "1.0.0",
130+
reason = "Weak pointers may not belong in this module.")]
130131
pub struct Weak<T> {
131132
// FIXME #12808: strange name to try to avoid interfering with
132133
// field accesses of the contained type via Deref
@@ -156,7 +157,7 @@ impl<T> Arc<T> {
156157
/// let five = Arc::new(5i);
157158
/// ```
158159
#[inline]
159-
#[stable]
160+
#[stable(feature = "grandfathered", since = "1.0.0")]
160161
pub fn new(data: T) -> Arc<T> {
161162
// Start the weak pointer count as 1 which is the weak pointer that's
162163
// held by all the strong pointers (kinda), see std/rc.rs for more info
@@ -179,7 +180,8 @@ impl<T> Arc<T> {
179180
///
180181
/// let weak_five = five.downgrade();
181182
/// ```
182-
#[unstable = "Weak pointers may not belong in this module."]
183+
#[unstable(feature = "unnamed_feature", since = "1.0.0",
184+
reason = "Weak pointers may not belong in this module.")]
183185
pub fn downgrade(&self) -> Weak<T> {
184186
// See the clone() impl for why this is relaxed
185187
self.inner().weak.fetch_add(1, Relaxed);
@@ -200,15 +202,15 @@ impl<T> Arc<T> {
200202

201203
/// Get the number of weak references to this value.
202204
#[inline]
203-
#[unstable]
205+
#[unstable(feature = "unnamed_feature", since = "1.0.0")]
204206
pub fn weak_count<T>(this: &Arc<T>) -> uint { this.inner().weak.load(SeqCst) - 1 }
205207

206208
/// Get the number of strong references to this value.
207209
#[inline]
208-
#[unstable]
210+
#[unstable(feature = "unnamed_feature", since = "1.0.0")]
209211
pub fn strong_count<T>(this: &Arc<T>) -> uint { this.inner().strong.load(SeqCst) }
210212

211-
#[stable]
213+
#[stable(feature = "grandfathered", since = "1.0.0")]
212214
impl<T> Clone for Arc<T> {
213215
/// Makes a clone of the `Arc<T>`.
214216
///
@@ -245,7 +247,7 @@ impl<T> BorrowFrom<Arc<T>> for T {
245247
}
246248
}
247249

248-
#[stable]
250+
#[stable(feature = "grandfathered", since = "1.0.0")]
249251
impl<T> Deref for Arc<T> {
250252
type Target = T;
251253

@@ -271,7 +273,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
271273
/// let mut_five = five.make_unique();
272274
/// ```
273275
#[inline]
274-
#[unstable]
276+
#[unstable(feature = "unnamed_feature", since = "1.0.0")]
275277
pub fn make_unique(&mut self) -> &mut T {
276278
// Note that we hold a strong reference, which also counts as a weak reference, so we only
277279
// clone if there is an additional reference of either kind.
@@ -289,7 +291,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
289291
}
290292

291293
#[unsafe_destructor]
292-
#[stable]
294+
#[stable(feature = "grandfathered", since = "1.0.0")]
293295
impl<T: Sync + Send> Drop for Arc<T> {
294296
/// Drops the `Arc<T>`.
295297
///
@@ -355,7 +357,8 @@ impl<T: Sync + Send> Drop for Arc<T> {
355357
}
356358
}
357359

358-
#[unstable = "Weak pointers may not belong in this module."]
360+
#[unstable(feature = "unnamed_feature", since = "1.0.0",
361+
reason = "Weak pointers may not belong in this module.")]
359362
impl<T: Sync + Send> Weak<T> {
360363
/// Upgrades a weak reference to a strong reference.
361364
///
@@ -393,7 +396,8 @@ impl<T: Sync + Send> Weak<T> {
393396
}
394397
}
395398

396-
#[unstable = "Weak pointers may not belong in this module."]
399+
#[unstable(feature = "unnamed_feature", since = "1.0.0",
400+
reason = "Weak pointers may not belong in this module.")]
397401
impl<T: Sync + Send> Clone for Weak<T> {
398402
/// Makes a clone of the `Weak<T>`.
399403
///
@@ -417,7 +421,7 @@ impl<T: Sync + Send> Clone for Weak<T> {
417421
}
418422

419423
#[unsafe_destructor]
420-
#[stable]
424+
#[stable(feature = "grandfathered", since = "1.0.0")]
421425
impl<T: Sync + Send> Drop for Weak<T> {
422426
/// Drops the `Weak<T>`.
423427
///
@@ -460,7 +464,7 @@ impl<T: Sync + Send> Drop for Weak<T> {
460464
}
461465
}
462466

463-
#[stable]
467+
#[stable(feature = "grandfathered", since = "1.0.0")]
464468
impl<T: PartialEq> PartialEq for Arc<T> {
465469
/// Equality for two `Arc<T>`s.
466470
///
@@ -492,7 +496,7 @@ impl<T: PartialEq> PartialEq for Arc<T> {
492496
/// ```
493497
fn ne(&self, other: &Arc<T>) -> bool { *(*self) != *(*other) }
494498
}
495-
#[stable]
499+
#[stable(feature = "grandfathered", since = "1.0.0")]
496500
impl<T: PartialOrd> PartialOrd for Arc<T> {
497501
/// Partial comparison for two `Arc<T>`s.
498502
///
@@ -571,11 +575,11 @@ impl<T: PartialOrd> PartialOrd for Arc<T> {
571575
/// ```
572576
fn ge(&self, other: &Arc<T>) -> bool { *(*self) >= *(*other) }
573577
}
574-
#[stable]
578+
#[stable(feature = "grandfathered", since = "1.0.0")]
575579
impl<T: Ord> Ord for Arc<T> {
576580
fn cmp(&self, other: &Arc<T>) -> Ordering { (**self).cmp(&**other) }
577581
}
578-
#[stable]
582+
#[stable(feature = "grandfathered", since = "1.0.0")]
579583
impl<T: Eq> Eq for Arc<T> {}
580584

581585
impl<T: fmt::Show> fmt::Show for Arc<T> {
@@ -584,16 +588,16 @@ impl<T: fmt::Show> fmt::Show for Arc<T> {
584588
}
585589
}
586590

587-
#[stable]
591+
#[stable(feature = "grandfathered", since = "1.0.0")]
588592
impl<T: fmt::String> fmt::String for Arc<T> {
589593
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
590594
fmt::String::fmt(&**self, f)
591595
}
592596
}
593597

594-
#[stable]
598+
#[stable(feature = "grandfathered", since = "1.0.0")]
595599
impl<T: Default + Sync + Send> Default for Arc<T> {
596-
#[stable]
600+
#[stable(feature = "grandfathered", since = "1.0.0")]
597601
fn default() -> Arc<T> { Arc::new(Default::default()) }
598602
}
599603

src/liballoc/boxed.rs

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! A unique pointer type.
1212
13-
#![stable]
13+
#![stable(feature = "grandfathered", since = "1.0.0")]
1414

1515
use core::any::Any;
1616
use core::clone::Clone;
@@ -44,35 +44,36 @@ use core::ops::{Deref, DerefMut};
4444
/// }
4545
/// ```
4646
#[lang = "exchange_heap"]
47-
#[unstable = "may be renamed; uncertain about custom allocator design"]
47+
#[unstable(feature = "unnamed_feature", since = "1.0.0",
48+
reason = "may be renamed; uncertain about custom allocator design")]
4849
pub static HEAP: () = ();
4950

5051
/// A type that represents a uniquely-owned value.
5152
#[lang = "owned_box"]
52-
#[stable]
53+
#[stable(feature = "grandfathered", since = "1.0.0")]
5354
pub struct Box<T>(Unique<T>);
5455

5556
impl<T> Box<T> {
5657
/// Moves `x` into a freshly allocated box on the global exchange heap.
57-
#[stable]
58+
#[stable(feature = "grandfathered", since = "1.0.0")]
5859
pub fn new(x: T) -> Box<T> {
5960
box x
6061
}
6162
}
6263

63-
#[stable]
64+
#[stable(feature = "grandfathered", since = "1.0.0")]
6465
impl<T: Default> Default for Box<T> {
65-
#[stable]
66+
#[stable(feature = "grandfathered", since = "1.0.0")]
6667
fn default() -> Box<T> { box Default::default() }
6768
}
6869

69-
#[stable]
70+
#[stable(feature = "grandfathered", since = "1.0.0")]
7071
impl<T> Default for Box<[T]> {
71-
#[stable]
72+
#[stable(feature = "grandfathered", since = "1.0.0")]
7273
fn default() -> Box<[T]> { box [] }
7374
}
7475

75-
#[stable]
76+
#[stable(feature = "grandfathered", since = "1.0.0")]
7677
impl<T: Clone> Clone for Box<T> {
7778
/// Returns a copy of the owned box.
7879
#[inline]
@@ -85,14 +86,14 @@ impl<T: Clone> Clone for Box<T> {
8586
}
8687
}
8788

88-
#[stable]
89+
#[stable(feature = "grandfathered", since = "1.0.0")]
8990
impl<T: ?Sized + PartialEq> PartialEq for Box<T> {
9091
#[inline]
9192
fn eq(&self, other: &Box<T>) -> bool { PartialEq::eq(&**self, &**other) }
9293
#[inline]
9394
fn ne(&self, other: &Box<T>) -> bool { PartialEq::ne(&**self, &**other) }
9495
}
95-
#[stable]
96+
#[stable(feature = "grandfathered", since = "1.0.0")]
9697
impl<T: ?Sized + PartialOrd> PartialOrd for Box<T> {
9798
#[inline]
9899
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
@@ -107,14 +108,14 @@ impl<T: ?Sized + PartialOrd> PartialOrd for Box<T> {
107108
#[inline]
108109
fn gt(&self, other: &Box<T>) -> bool { PartialOrd::gt(&**self, &**other) }
109110
}
110-
#[stable]
111+
#[stable(feature = "grandfathered", since = "1.0.0")]
111112
impl<T: ?Sized + Ord> Ord for Box<T> {
112113
#[inline]
113114
fn cmp(&self, other: &Box<T>) -> Ordering {
114115
Ord::cmp(&**self, &**other)
115116
}
116117
}
117-
#[stable]
118+
#[stable(feature = "grandfathered", since = "1.0.0")]
118119
impl<T: ?Sized + Eq> Eq for Box<T> {}
119120

120121
impl<S: hash::Hasher, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
@@ -125,19 +126,20 @@ impl<S: hash::Hasher, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
125126
}
126127

127128
/// Extension methods for an owning `Any` trait object.
128-
#[unstable = "this trait will likely disappear once compiler bugs blocking \
129-
a direct impl on `Box<Any>` have been fixed "]
129+
#[unstable(feature = "unnamed_feature", since = "1.0.0",
130+
reason = "this trait will likely disappear once compiler bugs blocking \
131+
a direct impl on `Box<Any>` have been fixed ")]
130132
// FIXME(#18737): this should be a direct impl on `Box<Any>`. If you're
131133
// removing this please make sure that you can downcase on
132134
// `Box<Any + Send>` as well as `Box<Any>`
133135
pub trait BoxAny {
134136
/// Returns the boxed value if it is of type `T`, or
135137
/// `Err(Self)` if it isn't.
136-
#[stable]
138+
#[stable(feature = "grandfathered", since = "1.0.0")]
137139
fn downcast<T: 'static>(self) -> Result<Box<T>, Self>;
138140
}
139141

140-
#[stable]
142+
#[stable(feature = "grandfathered", since = "1.0.0")]
141143
impl BoxAny for Box<Any> {
142144
#[inline]
143145
fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>> {
@@ -162,7 +164,7 @@ impl<T: ?Sized + fmt::Show> fmt::Show for Box<T> {
162164
}
163165
}
164166

165-
#[stable]
167+
#[stable(feature = "grandfathered", since = "1.0.0")]
166168
impl<T: ?Sized + fmt::String> fmt::String for Box<T> {
167169
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
168170
fmt::String::fmt(&**self, f)
@@ -175,14 +177,14 @@ impl fmt::Show for Box<Any> {
175177
}
176178
}
177179

178-
#[stable]
180+
#[stable(feature = "grandfathered", since = "1.0.0")]
179181
impl<T: ?Sized> Deref for Box<T> {
180182
type Target = T;
181183

182184
fn deref(&self) -> &T { &**self }
183185
}
184186

185-
#[stable]
187+
#[stable(feature = "grandfathered", since = "1.0.0")]
186188
impl<T: ?Sized> DerefMut for Box<T> {
187189
fn deref_mut(&mut self) -> &mut T { &mut **self }
188190
}

src/liballoc/heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub fn usable_size(size: uint, align: uint) -> uint {
8080
///
8181
/// These statistics may be inconsistent if other threads use the allocator
8282
/// during the call.
83-
#[unstable]
83+
#[unstable(feature = "unnamed_feature", since = "1.0.0")]
8484
pub fn stats_print() {
8585
imp::stats_print();
8686
}

src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
//! default global allocator. It is not compatible with the libc allocator API.
5858
5959
#![crate_name = "alloc"]
60-
#![unstable]
60+
#![unstable(feature = "unnamed_feature", since = "1.0.0")]
6161
#![staged_api]
6262
#![crate_type = "rlib"]
6363
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

0 commit comments

Comments
 (0)