about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-01 11:26:24 +0000
committerbors <bors@rust-lang.org>2018-09-01 11:26:24 +0000
commitfea32f1b775b3f37fc4abfa6391c1bebe48af9d1 (patch)
treeab51afef12f740e9b7e2ffd7595ce0869c7e45a1 /src/liballoc
parente6381a7f37402dd5f346256b3773ae2e72853fc3 (diff)
parent2839f4f0e8d58c295e146999961b78e2cc47354f (diff)
downloadrust-fea32f1b775b3f37fc4abfa6391c1bebe48af9d1.tar.gz
rust-fea32f1b775b3f37fc4abfa6391c1bebe48af9d1.zip
Auto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkor
Implement the `min_const_fn` feature gate

cc @RalfJung @eddyb

r? @Centril

implements the feature gate for #53555

I added a hack so the `const_fn` feature gate also enables the `min_const_fn` feature gate. This ensures that nightly users of `const_fn` don't have to touch their code at all.

The `min_const_fn` checks are run first, and if they succeeded, the `const_fn` checks are run additionally to ensure we didn't miss anything.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/lib.rs3
-rw-r--r--src/liballoc/tests/lib.rs3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 676c977514f..452d2b1472f 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -88,7 +88,8 @@
 #![feature(box_syntax)]
 #![feature(cfg_target_has_atomic)]
 #![feature(coerce_unsized)]
-#![feature(const_fn)]
+#![cfg_attr(stage0, feature(const_fn))]
+#![cfg_attr(not(stage0), feature(min_const_fn))]
 #![feature(core_intrinsics)]
 #![feature(custom_attribute)]
 #![feature(dropck_eyepatch)]
diff --git a/src/liballoc/tests/lib.rs b/src/liballoc/tests/lib.rs
index 3a84f9e7e47..710c659ac53 100644
--- a/src/liballoc/tests/lib.rs
+++ b/src/liballoc/tests/lib.rs
@@ -11,7 +11,8 @@
 #![feature(allocator_api)]
 #![feature(alloc_system)]
 #![feature(box_syntax)]
-#![feature(const_fn)]
+#![cfg_attr(stage0, feature(const_fn))]
+#![cfg_attr(not(stage0), feature(min_const_fn))]
 #![feature(drain_filter)]
 #![feature(exact_size_is_empty)]
 #![feature(pattern)]