Skip to content

Commit 1f70acb

Browse files
committed
Improvements to feature staging
This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer.
1 parent 5364c48 commit 1f70acb

Some content is hidden

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

105 files changed

+386
-392
lines changed

src/liballoc/arc.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ 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-
#[experimental = "Weak pointers may not belong in this module."]
129+
#[unstable = "Weak pointers may not belong in this module."]
130130
pub struct Weak<T> {
131131
// FIXME #12808: strange name to try to avoid interfering with
132132
// field accesses of the contained type via Deref
@@ -179,7 +179,7 @@ impl<T> Arc<T> {
179179
///
180180
/// let weak_five = five.downgrade();
181181
/// ```
182-
#[experimental = "Weak pointers may not belong in this module."]
182+
#[unstable = "Weak pointers may not belong in this module."]
183183
pub fn downgrade(&self) -> Weak<T> {
184184
// See the clone() impl for why this is relaxed
185185
self.inner().weak.fetch_add(1, Relaxed);
@@ -200,12 +200,12 @@ impl<T> Arc<T> {
200200

201201
/// Get the number of weak references to this value.
202202
#[inline]
203-
#[experimental]
203+
#[unstable]
204204
pub fn weak_count<T>(this: &Arc<T>) -> uint { this.inner().weak.load(SeqCst) - 1 }
205205

206206
/// Get the number of strong references to this value.
207207
#[inline]
208-
#[experimental]
208+
#[unstable]
209209
pub fn strong_count<T>(this: &Arc<T>) -> uint { this.inner().strong.load(SeqCst) }
210210

211211
#[stable]
@@ -271,7 +271,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
271271
/// let mut_five = five.make_unique();
272272
/// ```
273273
#[inline]
274-
#[experimental]
274+
#[unstable]
275275
pub fn make_unique(&mut self) -> &mut T {
276276
// Note that we hold a strong reference, which also counts as a weak reference, so we only
277277
// clone if there is an additional reference of either kind.
@@ -355,7 +355,7 @@ impl<T: Sync + Send> Drop for Arc<T> {
355355
}
356356
}
357357

358-
#[experimental = "Weak pointers may not belong in this module."]
358+
#[unstable = "Weak pointers may not belong in this module."]
359359
impl<T: Sync + Send> Weak<T> {
360360
/// Upgrades a weak reference to a strong reference.
361361
///
@@ -393,7 +393,7 @@ impl<T: Sync + Send> Weak<T> {
393393
}
394394
}
395395

396-
#[experimental = "Weak pointers may not belong in this module."]
396+
#[unstable = "Weak pointers may not belong in this module."]
397397
impl<T: Sync + Send> Clone for Weak<T> {
398398
/// Makes a clone of the `Weak<T>`.
399399
///
@@ -604,7 +604,7 @@ impl<H: Hasher, T: Hash<H>> Hash<H> for Arc<T> {
604604
}
605605

606606
#[cfg(test)]
607-
#[allow(experimental)]
607+
#[allow(unstable)]
608608
mod tests {
609609
use std::clone::Clone;
610610
use std::sync::mpsc::channel;

src/liballoc/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use core::ops::{Deref, DerefMut};
4444
/// }
4545
/// ```
4646
#[lang = "exchange_heap"]
47-
#[experimental = "may be renamed; uncertain about custom allocator design"]
47+
#[unstable = "may be renamed; uncertain about custom allocator design"]
4848
pub static HEAP: () = ();
4949

5050
/// A type that represents a uniquely-owned value.

src/liballoc/lib.rs

+1-1
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-
#![experimental]
60+
#![unstable]
6161
#![staged_api]
6262
#![crate_type = "rlib"]
6363
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

src/liballoc/rc.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<T> Rc<T> {
221221
///
222222
/// let weak_five = five.downgrade();
223223
/// ```
224-
#[experimental = "Weak pointers may not belong in this module"]
224+
#[unstable = "Weak pointers may not belong in this module"]
225225
pub fn downgrade(&self) -> Weak<T> {
226226
self.inc_weak();
227227
Weak {
@@ -234,12 +234,12 @@ impl<T> Rc<T> {
234234

235235
/// Get the number of weak references to this value.
236236
#[inline]
237-
#[experimental]
237+
#[unstable]
238238
pub fn weak_count<T>(this: &Rc<T>) -> uint { this.weak() - 1 }
239239

240240
/// Get the number of strong references to this value.
241241
#[inline]
242-
#[experimental]
242+
#[unstable]
243243
pub fn strong_count<T>(this: &Rc<T>) -> uint { this.strong() }
244244

245245
/// Returns true if there are no other `Rc` or `Weak<T>` values that share the same inner value.
@@ -255,7 +255,7 @@ pub fn strong_count<T>(this: &Rc<T>) -> uint { this.strong() }
255255
/// rc::is_unique(&five);
256256
/// ```
257257
#[inline]
258-
#[experimental]
258+
#[unstable]
259259
pub fn is_unique<T>(rc: &Rc<T>) -> bool {
260260
weak_count(rc) == 0 && strong_count(rc) == 1
261261
}
@@ -277,7 +277,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
277277
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4u)));
278278
/// ```
279279
#[inline]
280-
#[experimental]
280+
#[unstable]
281281
pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
282282
if is_unique(&rc) {
283283
unsafe {
@@ -311,7 +311,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
311311
/// assert!(rc::get_mut(&mut x).is_none());
312312
/// ```
313313
#[inline]
314-
#[experimental]
314+
#[unstable]
315315
pub fn get_mut<'a, T>(rc: &'a mut Rc<T>) -> Option<&'a mut T> {
316316
if is_unique(rc) {
317317
let inner = unsafe { &mut **rc._ptr };
@@ -337,7 +337,7 @@ impl<T: Clone> Rc<T> {
337337
/// let mut_five = five.make_unique();
338338
/// ```
339339
#[inline]
340-
#[experimental]
340+
#[unstable]
341341
pub fn make_unique(&mut self) -> &mut T {
342342
if !is_unique(self) {
343343
*self = Rc::new((**self).clone())
@@ -615,7 +615,7 @@ impl<S: hash::Hasher, T: Hash<S>> Hash<S> for Rc<T> {
615615
}
616616
}
617617

618-
#[experimental = "Show is experimental."]
618+
#[unstable = "Show is experimental."]
619619
impl<T: fmt::Show> fmt::Show for Rc<T> {
620620
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
621621
write!(f, "Rc({:?})", **self)
@@ -635,7 +635,7 @@ impl<T: fmt::String> fmt::String for Rc<T> {
635635
///
636636
/// See the [module level documentation](../index.html) for more.
637637
#[unsafe_no_drop_flag]
638-
#[experimental = "Weak pointers may not belong in this module."]
638+
#[unstable = "Weak pointers may not belong in this module."]
639639
pub struct Weak<T> {
640640
// FIXME #12808: strange names to try to avoid interfering with
641641
// field accesses of the contained type via Deref
@@ -644,7 +644,7 @@ pub struct Weak<T> {
644644
_noshare: marker::NoSync
645645
}
646646

647-
#[experimental = "Weak pointers may not belong in this module."]
647+
#[unstable = "Weak pointers may not belong in this module."]
648648
impl<T> Weak<T> {
649649
/// Upgrades a weak reference to a strong reference.
650650
///
@@ -717,7 +717,7 @@ impl<T> Drop for Weak<T> {
717717
}
718718
}
719719

720-
#[experimental = "Weak pointers may not belong in this module."]
720+
#[unstable = "Weak pointers may not belong in this module."]
721721
impl<T> Clone for Weak<T> {
722722
/// Makes a clone of the `Weak<T>`.
723723
///
@@ -739,7 +739,7 @@ impl<T> Clone for Weak<T> {
739739
}
740740
}
741741

742-
#[experimental = "Show is experimental."]
742+
#[unstable = "Show is experimental."]
743743
impl<T: fmt::Show> fmt::Show for Weak<T> {
744744
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
745745
write!(f, "(Weak)")
@@ -780,7 +780,7 @@ impl<T> RcBoxPtr<T> for Weak<T> {
780780
}
781781

782782
#[cfg(test)]
783-
#[allow(experimental)]
783+
#[allow(unstable)]
784784
mod tests {
785785
use super::{Rc, Weak, weak_count, strong_count};
786786
use std::cell::RefCell;

src/libarena/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
//! more complex, slower arena which can hold objects of any type.
2121
2222
#![crate_name = "arena"]
23-
#![experimental]
23+
#![unstable]
2424
#![staged_api]
2525
#![crate_type = "rlib"]
2626
#![crate_type = "dylib"]

src/libcollections/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515

1616
#![crate_name = "collections"]
17-
#![experimental]
17+
#![unstable]
1818
#![staged_api]
1919
#![crate_type = "rlib"]
2020
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",

src/libcollections/slice.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub trait SliceExt {
166166
/// assert_eq!(num_moved, 3);
167167
/// assert!(a == [6i, 7, 8, 4, 5]);
168168
/// ```
169-
#[experimental = "uncertain about this API approach"]
169+
#[unstable = "uncertain about this API approach"]
170170
fn move_from(&mut self, src: Vec<Self::Item>, start: uint, end: uint) -> uint;
171171

172172
/// Returns a subslice spanning the interval [`start`, `end`).
@@ -175,23 +175,23 @@ pub trait SliceExt {
175175
/// original slice (i.e. when `end > self.len()`) or when `start > end`.
176176
///
177177
/// Slicing with `start` equal to `end` yields an empty slice.
178-
#[experimental = "will be replaced by slice syntax"]
178+
#[unstable = "will be replaced by slice syntax"]
179179
fn slice(&self, start: uint, end: uint) -> &[Self::Item];
180180

181181
/// Returns a subslice from `start` to the end of the slice.
182182
///
183183
/// Panics when `start` is strictly greater than the length of the original slice.
184184
///
185185
/// Slicing from `self.len()` yields an empty slice.
186-
#[experimental = "will be replaced by slice syntax"]
186+
#[unstable = "will be replaced by slice syntax"]
187187
fn slice_from(&self, start: uint) -> &[Self::Item];
188188

189189
/// Returns a subslice from the start of the slice to `end`.
190190
///
191191
/// Panics when `end` is strictly greater than the length of the original slice.
192192
///
193193
/// Slicing to `0` yields an empty slice.
194-
#[experimental = "will be replaced by slice syntax"]
194+
#[unstable = "will be replaced by slice syntax"]
195195
fn slice_to(&self, end: uint) -> &[Self::Item];
196196

197197
/// Divides one slice into two at an index.
@@ -284,11 +284,11 @@ pub trait SliceExt {
284284
fn first(&self) -> Option<&Self::Item>;
285285

286286
/// Returns all but the first element of a slice.
287-
#[experimental = "likely to be renamed"]
287+
#[unstable = "likely to be renamed"]
288288
fn tail(&self) -> &[Self::Item];
289289

290290
/// Returns all but the last element of a slice.
291-
#[experimental = "likely to be renamed"]
291+
#[unstable = "likely to be renamed"]
292292
fn init(&self) -> &[Self::Item];
293293

294294
/// Returns the last element of a slice, or `None` if it is empty.
@@ -384,23 +384,23 @@ pub trait SliceExt {
384384
/// original slice (i.e. when `end > self.len()`) or when `start > end`.
385385
///
386386
/// Slicing with `start` equal to `end` yields an empty slice.
387-
#[experimental = "will be replaced by slice syntax"]
387+
#[unstable = "will be replaced by slice syntax"]
388388
fn slice_mut(&mut self, start: uint, end: uint) -> &mut [Self::Item];
389389

390390
/// Returns a mutable subslice from `start` to the end of the slice.
391391
///
392392
/// Panics when `start` is strictly greater than the length of the original slice.
393393
///
394394
/// Slicing from `self.len()` yields an empty slice.
395-
#[experimental = "will be replaced by slice syntax"]
395+
#[unstable = "will be replaced by slice syntax"]
396396
fn slice_from_mut(&mut self, start: uint) -> &mut [Self::Item];
397397

398398
/// Returns a mutable subslice from the start of the slice to `end`.
399399
///
400400
/// Panics when `end` is strictly greater than the length of the original slice.
401401
///
402402
/// Slicing to `0` yields an empty slice.
403-
#[experimental = "will be replaced by slice syntax"]
403+
#[unstable = "will be replaced by slice syntax"]
404404
fn slice_to_mut(&mut self, end: uint) -> &mut [Self::Item];
405405

406406
/// Returns an iterator that allows modifying each value
@@ -412,11 +412,11 @@ pub trait SliceExt {
412412
fn first_mut(&mut self) -> Option<&mut Self::Item>;
413413

414414
/// Returns all but the first element of a mutable slice
415-
#[experimental = "likely to be renamed or removed"]
415+
#[unstable = "likely to be renamed or removed"]
416416
fn tail_mut(&mut self) -> &mut [Self::Item];
417417

418418
/// Returns all but the last element of a mutable slice
419-
#[experimental = "likely to be renamed or removed"]
419+
#[unstable = "likely to be renamed or removed"]
420420
fn init_mut(&mut self) -> &mut [Self::Item];
421421

422422
/// Returns a mutable pointer to the last item in the slice.
@@ -588,7 +588,7 @@ pub trait SliceExt {
588588
/// assert!(dst.clone_from_slice(&src2) == 3);
589589
/// assert!(dst == [3i, 4, 5]);
590590
/// ```
591-
#[experimental]
591+
#[unstable]
592592
fn clone_from_slice(&mut self, &[Self::Item]) -> uint where Self::Item: Clone;
593593

594594
/// Sorts the slice, in place.
@@ -677,11 +677,11 @@ pub trait SliceExt {
677677
fn prev_permutation(&mut self) -> bool where Self::Item: Ord;
678678

679679
/// Find the first index containing a matching value.
680-
#[experimental]
680+
#[unstable]
681681
fn position_elem(&self, t: &Self::Item) -> Option<uint> where Self::Item: PartialEq;
682682

683683
/// Find the last index containing a matching value.
684-
#[experimental]
684+
#[unstable]
685685
fn rposition_elem(&self, t: &Self::Item) -> Option<uint> where Self::Item: PartialEq;
686686

687687
/// Return true if the slice contains an element with the given value.
@@ -697,7 +697,7 @@ pub trait SliceExt {
697697
fn ends_with(&self, needle: &[Self::Item]) -> bool where Self::Item: PartialEq;
698698

699699
/// Convert `self` into a vector without clones or allocation.
700-
#[experimental]
700+
#[unstable]
701701
fn into_vec(self: Box<Self>) -> Vec<Self::Item>;
702702
}
703703

@@ -1034,7 +1034,7 @@ impl<T: Clone, V: AsSlice<T>> SliceConcatExt<T, Vec<T>> for [V] {
10341034
///
10351035
/// The last generated swap is always (0, 1), and it returns the
10361036
/// sequence to its initial order.
1037-
#[experimental]
1037+
#[unstable]
10381038
#[derive(Clone)]
10391039
pub struct ElementSwaps {
10401040
sdir: Vec<SizeDirection>,
@@ -1046,7 +1046,7 @@ pub struct ElementSwaps {
10461046

10471047
impl ElementSwaps {
10481048
/// Creates an `ElementSwaps` iterator for a sequence of `length` elements.
1049-
#[experimental]
1049+
#[unstable]
10501050
pub fn new(length: uint) -> ElementSwaps {
10511051
// Initialize `sdir` with a direction that position should move in
10521052
// (all negative at the beginning) and the `size` of the

0 commit comments

Comments
 (0)