about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorFlorian Warzecha <liketechnik@disroot.org>2020-10-21 20:54:20 +0200
committerFlorian Warzecha <liketechnik@disroot.org>2020-10-21 20:54:20 +0200
commit05f4a9a42abbbdb64d3ec4ed0ae6883c10c66e3f (patch)
tree06d63b7fdbcdced0725fcd426494a3c8be2b3904 /library/alloc/src
parent3948b054dc8e598b83a194056dc4d3a0852dc79e (diff)
downloadrust-05f4a9a42abbbdb64d3ec4ed0ae6883c10c66e3f.tar.gz
rust-05f4a9a42abbbdb64d3ec4ed0ae6883c10c66e3f.zip
switch allow_internal_unstable const fns to rustc_allow_const_fn_unstable
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/lib.rs1
-rw-r--r--library/alloc/src/raw_vec.rs3
2 files changed, 3 insertions, 1 deletions
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index b69e19072af..ccabc336acc 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -72,6 +72,7 @@
 #![allow(explicit_outlives_requirements)]
 #![allow(incomplete_features)]
 #![deny(unsafe_op_in_unsafe_fn)]
+#![cfg_attr(not(bootstrap), feature(rustc_allow_const_fn_unstable))]
 #![cfg_attr(not(test), feature(generator_trait))]
 #![cfg_attr(test, feature(test))]
 #![cfg_attr(test, feature(new_uninit))]
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 1844d3ae004..43628259ba3 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -150,7 +150,8 @@ 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)]
+    #[cfg_attr(not(bootstrap), rustc_allow_const_fn_unstable(const_fn))]
+    #[cfg_attr(bootstrap, 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 }