diff options
| author | Brian Anderson <banderson@mozilla.com> | 2015-01-22 18:22:03 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2015-01-23 13:28:40 -0800 |
| commit | cd6d9eab5d75584edfcae4ffdef8b0836db80c1e (patch) | |
| tree | fff2c174986eaab33f67390d0a114d508966fe68 /src/liballoc/rc.rs | |
| parent | f86bcc1543cb053363c5e6818a2ad44877ea8361 (diff) | |
| download | rust-cd6d9eab5d75584edfcae4ffdef8b0836db80c1e.tar.gz rust-cd6d9eab5d75584edfcae4ffdef8b0836db80c1e.zip | |
Set unstable feature names appropriately
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
Diffstat (limited to 'src/liballoc/rc.rs')
| -rw-r--r-- | src/liballoc/rc.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 4e3c165361b..81336cfd230 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -268,7 +268,7 @@ impl<T> Rc<T> { /// let weak_five = five.downgrade(); /// ``` #[cfg(stage0)] // NOTE remove after next snapshot - #[unstable(feature = "unnamed_feature", + #[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module")] pub fn downgrade(&self) -> Weak<T> { self.inc_weak(); @@ -291,7 +291,7 @@ impl<T> Rc<T> { /// let weak_five = five.downgrade(); /// ``` #[cfg(not(stage0))] // NOTE remove cfg after next snapshot - #[unstable(feature = "unnamed_feature", + #[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module")] pub fn downgrade(&self) -> Weak<T> { self.inc_weak(); @@ -301,12 +301,12 @@ impl<T> Rc<T> { /// Get the number of weak references to this value. #[inline] -#[unstable(feature = "unnamed_feature")] +#[unstable(feature = "alloc")] pub fn weak_count<T>(this: &Rc<T>) -> uint { this.weak() - 1 } /// Get the number of strong references to this value. #[inline] -#[unstable(feature = "unnamed_feature")] +#[unstable(feature = "alloc")] pub fn strong_count<T>(this: &Rc<T>) -> uint { this.strong() } /// Returns true if there are no other `Rc` or `Weak<T>` values that share the same inner value. @@ -322,7 +322,7 @@ pub fn strong_count<T>(this: &Rc<T>) -> uint { this.strong() } /// rc::is_unique(&five); /// ``` #[inline] -#[unstable(feature = "unnamed_feature")] +#[unstable(feature = "alloc")] pub fn is_unique<T>(rc: &Rc<T>) -> bool { weak_count(rc) == 0 && strong_count(rc) == 1 } @@ -344,7 +344,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool { /// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4u))); /// ``` #[inline] -#[unstable(feature = "unnamed_feature")] +#[unstable(feature = "alloc")] pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { if is_unique(&rc) { unsafe { @@ -378,7 +378,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> { /// assert!(rc::get_mut(&mut x).is_none()); /// ``` #[inline] -#[unstable(feature = "unnamed_feature")] +#[unstable(feature = "alloc")] pub fn get_mut<'a, T>(rc: &'a mut Rc<T>) -> Option<&'a mut T> { if is_unique(rc) { let inner = unsafe { &mut **rc._ptr }; @@ -404,7 +404,7 @@ impl<T: Clone> Rc<T> { /// let mut_five = five.make_unique(); /// ``` #[inline] - #[unstable(feature = "unnamed_feature")] + #[unstable(feature = "alloc")] pub fn make_unique(&mut self) -> &mut T { if !is_unique(self) { *self = Rc::new((**self).clone()) @@ -695,7 +695,7 @@ impl<S: hash::Hasher, T: Hash<S>> Hash<S> for Rc<T> { } } -#[unstable(feature = "unnamed_feature", reason = "Show is experimental.")] +#[unstable(feature = "alloc", reason = "Show is experimental.")] impl<T: fmt::Show> fmt::Show for Rc<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Rc({:?})", **self) @@ -716,7 +716,7 @@ impl<T: fmt::String> fmt::String for Rc<T> { /// See the [module level documentation](../index.html) for more. #[unsafe_no_drop_flag] #[cfg(stage0)] // NOTE remove impl after next snapshot -#[unstable(feature = "unnamed_feature", +#[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] pub struct Weak<T> { // FIXME #12808: strange names to try to avoid interfering with @@ -732,7 +732,7 @@ pub struct Weak<T> { /// /// See the [module level documentation](../index.html) for more. #[unsafe_no_drop_flag] -#[unstable(feature = "unnamed_feature", +#[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] #[cfg(not(stage0))] // NOTE remove cfg after next snapshot pub struct Weak<T> { @@ -748,7 +748,7 @@ impl<T> !marker::Send for Weak<T> {} impl<T> !marker::Sync for Weak<T> {} -#[unstable(feature = "unnamed_feature", +#[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] impl<T> Weak<T> { /// Upgrades a weak reference to a strong reference. @@ -850,7 +850,7 @@ impl<T> Drop for Weak<T> { } } -#[unstable(feature = "unnamed_feature", +#[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] impl<T> Clone for Weak<T> { /// Makes a clone of the `Weak<T>`. @@ -894,7 +894,7 @@ impl<T> Clone for Weak<T> { } } -#[unstable(feature = "unnamed_feature", reason = "Show is experimental.")] +#[unstable(feature = "alloc", reason = "Show is experimental.")] impl<T: fmt::Show> fmt::Show for Weak<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "(Weak)") |
