about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-17 11:02:56 -0700
committerDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-22 10:05:58 -0700
commit110e59e70e21b2c93dc0cd48f22dea292cf62b75 (patch)
treecb451a819e223065d7909b2460c670bc0bfea91e /library/alloc/src
parent3dd28c78c3c3f0fad72bfa41dd9655ce9d7b4bd5 (diff)
Update library functions with stability attributes
This may not be strictly minimal, but all unstable functions also need a
`rustc_const_unstable` attribute.
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/borrow.rs2
-rw-r--r--library/alloc/src/lib.rs2
-rw-r--r--library/alloc/src/raw_vec.rs1
3 files changed, 5 insertions, 0 deletions
diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs
index e7260f3956c..f801c1ac75b 100644
--- a/library/alloc/src/borrow.rs
+++ b/library/alloc/src/borrow.rs
@@ -217,6 +217,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
     /// assert!(!bull.is_borrowed());
     /// ```
     #[unstable(feature = "cow_is_borrowed", issue = "65143")]
+    #[rustc_const_unstable(feature = "const_cow_is_borrowed", issue = "65143")]
     pub const fn is_borrowed(&self) -> bool {
         match *self {
             Borrowed(_) => true,
@@ -239,6 +240,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
     /// assert!(!bull.is_owned());
     /// ```
     #[unstable(feature = "cow_is_borrowed", issue = "65143")]
+    #[rustc_const_unstable(feature = "const_cow_is_borrowed", issue = "65143")]
     pub const fn is_owned(&self) -> bool {
         !self.is_borrowed()
     }
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 5ae4b7cf36a..b33cb3ad8e8 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -86,9 +86,11 @@
 #![feature(cfg_target_has_atomic)]
 #![feature(coerce_unsized)]
 #![feature(const_btree_new)]
+#![feature(const_fn)]
 #![feature(const_generics)]
 #![feature(const_in_array_repeat_expressions)]
 #![feature(cow_is_borrowed)]
+#![feature(const_cow_is_borrowed)]
 #![feature(dispatch_from_dyn)]
 #![feature(core_intrinsics)]
 #![feature(dropck_eyepatch)]
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index e33dddc4f98..e6da5990060 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -150,6 +150,7 @@ impl<T> RawVec<T, Global> {
 impl<T, A: AllocRef> RawVec<T, A> {
     /// Like `new`, but parameterized over the choice of allocator for
     /// the returned `RawVec`.
+    #[allow_internal_unstable(const_fn)]
     pub const fn new_in(alloc: A) -> Self {
         // `cap: 0` means "unallocated". zero-sized types are ignored.
         Self { ptr: Unique::dangling(), cap: 0, alloc }