about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-06-09 11:52:41 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-06-17 09:06:59 -0700
commitc44f5399e4dd2f9d55e107d365d6fe98f6491dc9 (patch)
treefe557c5b621a33775c55189ea9fe9210c4d2b9a9 /src/liballoc
parentc14d86fd3ff3ba2d01a6e859290b30e74081313b (diff)
downloadrust-c44f5399e4dd2f9d55e107d365d6fe98f6491dc9.tar.gz
rust-c44f5399e4dd2f9d55e107d365d6fe98f6491dc9.zip
alloc: Split apart the global `alloc` feature
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs16
-rw-r--r--src/liballoc/boxed.rs6
-rw-r--r--src/liballoc/heap.rs7
-rw-r--r--src/liballoc/lib.rs10
-rw-r--r--src/liballoc/rc.rs20
5 files changed, 34 insertions, 25 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 616071f0df7..e0d459d877f 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -134,7 +134,7 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
 /// Weak pointers will not keep the data inside of the `Arc` alive, and can be
 /// used to break cycles between `Arc` pointers.
 #[unsafe_no_drop_flag]
-#[unstable(feature = "alloc",
+#[unstable(feature = "arc_weak",
            reason = "Weak pointers may not belong in this module.")]
 pub struct Weak<T: ?Sized> {
     // FIXME #12808: strange name to try to avoid interfering with
@@ -198,7 +198,7 @@ impl<T: ?Sized> Arc<T> {
     ///
     /// let weak_five = five.downgrade();
     /// ```
-    #[unstable(feature = "alloc",
+    #[unstable(feature = "arc_weak",
                reason = "Weak pointers may not belong in this module.")]
     pub fn downgrade(&self) -> Weak<T> {
         // See the clone() impl for why this is relaxed
@@ -236,12 +236,12 @@ impl<T: ?Sized> Arc<T> {
 
 /// Get the number of weak references to this value.
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "arc_extras")]
 pub fn weak_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().weak.load(SeqCst) - 1 }
 
 /// Get the number of strong references to this value.
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "arc_extras")]
 pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst) }
 
 
@@ -271,7 +271,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa
 /// # }
 /// ```
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "arc_extras")]
 pub unsafe fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> {
     // FIXME(#24880) potential race with upgraded weak pointers here
     if strong_count(this) == 1 && weak_count(this) == 0 {
@@ -352,7 +352,7 @@ impl<T: Clone> Arc<T> {
     /// # }
     /// ```
     #[inline]
-    #[unstable(feature = "alloc")]
+    #[unstable(feature = "arc_extras")]
     pub unsafe fn make_unique(&mut self) -> &mut T {
         // FIXME(#24880) potential race with upgraded weak pointers here
         //
@@ -438,7 +438,7 @@ impl<T: ?Sized> Drop for Arc<T> {
     }
 }
 
-#[unstable(feature = "alloc",
+#[unstable(feature = "arc_weak",
            reason = "Weak pointers may not belong in this module.")]
 impl<T: ?Sized> Weak<T> {
     /// Upgrades a weak reference to a strong reference.
@@ -479,7 +479,7 @@ impl<T: ?Sized> Weak<T> {
     }
 }
 
-#[unstable(feature = "alloc",
+#[unstable(feature = "arc_weak",
            reason = "Weak pointers may not belong in this module.")]
 impl<T: ?Sized> Clone for Weak<T> {
     /// Makes a clone of the `Weak<T>`.
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index 91cbd3915d0..ffc4186dee8 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -81,7 +81,7 @@ use core::raw::{TraitObject};
 /// }
 /// ```
 #[lang = "exchange_heap"]
-#[unstable(feature = "alloc",
+#[unstable(feature = "box_heap",
            reason = "may be renamed; uncertain about custom allocator design")]
 pub const HEAP: () = ();
 
@@ -121,7 +121,7 @@ impl<T : ?Sized> Box<T> {
     /// Function is unsafe, because improper use of this function may
     /// lead to memory problems like double-free, for example if the
     /// function is called twice on the same raw pointer.
-    #[unstable(feature = "alloc",
+    #[unstable(feature = "box_raw",
                reason = "may be renamed or moved out of Box scope")]
     #[inline]
     pub unsafe fn from_raw(raw: *mut T) -> Self {
@@ -146,7 +146,7 @@ impl<T : ?Sized> Box<T> {
 /// let raw = boxed::into_raw(seventeen);
 /// let boxed_again = unsafe { Box::from_raw(raw) };
 /// ```
-#[unstable(feature = "alloc",
+#[unstable(feature = "box_raw",
            reason = "may be renamed")]
 #[inline]
 pub fn into_raw<T : ?Sized>(b: Box<T>) -> *mut T {
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 1cc63588fdd..14797d7f4b5 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -8,6 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![unstable(feature = "heap_api",
+            reason = "the precise API and guarantees it provides may be tweaked \
+                      slightly, especially to possibly take into account the \
+                      types being stored to make room for a future \
+                      tracing garbage collector")]
+
 use core::{isize, usize};
 
 #[inline(always)]
@@ -94,7 +100,6 @@ pub fn usable_size(size: usize, align: usize) -> usize {
 ///
 /// These statistics may be inconsistent if other threads use the allocator
 /// during the call.
-#[unstable(feature = "alloc")]
 pub fn stats_print() {
     imp::stats_print();
 }
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 91585c3cb6c..e297d4cbf77 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -59,9 +59,11 @@
 // Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
 #![cfg_attr(stage0, feature(custom_attribute))]
 #![crate_name = "alloc"]
-#![unstable(feature = "alloc")]
-#![staged_api]
 #![crate_type = "rlib"]
+#![staged_api]
+#![unstable(feature = "alloc",
+            reason = "this library is unlikely to be stabilized in its current \
+                      form or name")]
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
        html_root_url = "http://doc.rust-lang.org/nightly/",
@@ -86,11 +88,11 @@
 #![feature(unique)]
 #![feature(unsafe_no_drop_flag, filling_drop)]
 #![feature(unsize)]
+
 #![cfg_attr(test, feature(test, alloc, rustc_private))]
 #![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
             feature(libc))]
 
-
 #[macro_use]
 extern crate core;
 
@@ -124,6 +126,7 @@ pub mod rc;
 /// Common out-of-memory routine
 #[cold]
 #[inline(never)]
+#[unstable(feature = "oom", reason = "not a scrutinized interface")]
 pub fn oom() -> ! {
     // FIXME(#14674): This really needs to do something other than just abort
     //                here, but any printing done must be *guaranteed* to not
@@ -144,4 +147,5 @@ pub fn oom() -> ! {
 //                to get linked in to libstd successfully (the linker won't
 //                optimize it out).
 #[doc(hidden)]
+#[unstable(feature = "issue_14344_fixme")]
 pub fn fixme_14344_be_sure_to_link_to_collections() {}
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 44f4a6a6290..04dde7a07f9 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -236,7 +236,7 @@ impl<T: ?Sized> Rc<T> {
     ///
     /// let weak_five = five.downgrade();
     /// ```
-    #[unstable(feature = "alloc",
+    #[unstable(feature = "rc_weak",
                reason = "Weak pointers may not belong in this module")]
     pub fn downgrade(&self) -> Weak<T> {
         self.inc_weak();
@@ -246,12 +246,12 @@ impl<T: ?Sized> Rc<T> {
 
 /// Get the number of weak references to this value.
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "rc_extras")]
 pub fn weak_count<T: ?Sized>(this: &Rc<T>) -> usize { this.weak() - 1 }
 
 /// Get the number of strong references to this value.
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "rc_extras")]
 pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() }
 
 /// Returns true if there are no other `Rc` or `Weak<T>` values that share the
@@ -269,7 +269,7 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() }
 /// rc::is_unique(&five);
 /// ```
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "rc_extras")]
 pub fn is_unique<T>(rc: &Rc<T>) -> bool {
     weak_count(rc) == 0 && strong_count(rc) == 1
 }
@@ -292,7 +292,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
 /// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4)));
 /// ```
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "rc_extras")]
 pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
     if is_unique(&rc) {
         unsafe {
@@ -327,7 +327,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
 /// assert!(rc::get_mut(&mut x).is_none());
 /// ```
 #[inline]
-#[unstable(feature = "alloc")]
+#[unstable(feature = "rc_extras")]
 pub fn get_mut<T>(rc: &mut Rc<T>) -> Option<&mut T> {
     if is_unique(rc) {
         let inner = unsafe { &mut **rc._ptr };
@@ -354,7 +354,7 @@ impl<T: Clone> Rc<T> {
     /// let mut_five = five.make_unique();
     /// ```
     #[inline]
-    #[unstable(feature = "alloc")]
+    #[unstable(feature = "rc_extras")]
     pub fn make_unique(&mut self) -> &mut T {
         if !is_unique(self) {
             *self = Rc::new((**self).clone())
@@ -652,7 +652,7 @@ impl<T> fmt::Pointer for Rc<T> {
 ///
 /// See the [module level documentation](./index.html) for more.
 #[unsafe_no_drop_flag]
-#[unstable(feature = "alloc",
+#[unstable(feature = "rc_weak",
            reason = "Weak pointers may not belong in this module.")]
 pub struct Weak<T: ?Sized> {
     // FIXME #12808: strange names to try to avoid interfering with
@@ -663,7 +663,7 @@ pub struct Weak<T: ?Sized> {
 impl<T: ?Sized> !marker::Send for Weak<T> {}
 impl<T: ?Sized> !marker::Sync for Weak<T> {}
 
-#[unstable(feature = "alloc",
+#[unstable(feature = "rc_weak",
            reason = "Weak pointers may not belong in this module.")]
 impl<T: ?Sized> Weak<T> {
 
@@ -741,7 +741,7 @@ impl<T: ?Sized> Drop for Weak<T> {
     }
 }
 
-#[unstable(feature = "alloc",
+#[unstable(feature = "rc_weak",
            reason = "Weak pointers may not belong in this module.")]
 impl<T: ?Sized> Clone for Weak<T> {