about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-10-07 13:37:07 +0000
committerbors <bors@rust-lang.org>2018-10-07 13:37:07 +0000
commit0ee045ea09127e5318e9cb1fff85ec34b9e3e6eb (patch)
treece87285cf79fb4f3e06d6a68114505fe1e842e49 /src/libsyntax
parent5a6f122126c35a1a4ab7f3ef070e07a256ee0116 (diff)
parentfb04e2644730f48ff257d467c2ef6e25274e17d1 (diff)
downloadrust-0ee045ea09127e5318e9cb1fff85ec34b9e3e6eb.tar.gz
rust-0ee045ea09127e5318e9cb1fff85ec34b9e3e6eb.zip
Auto merge of #54835 - oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_sein, r=Centril
Stabilize `min_const_fn`

tracking issue: #53555

r? @Centril
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/attr/builtin.rs3
-rw-r--r--src/libsyntax/feature_gate.rs24
2 files changed, 4 insertions, 23 deletions
diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs
index f1cec422420..1cc2e62a9c6 100644
--- a/src/libsyntax/attr/builtin.rs
+++ b/src/libsyntax/attr/builtin.rs
@@ -107,8 +107,7 @@ pub struct Stability {
     pub level: StabilityLevel,
     pub feature: Symbol,
     pub rustc_depr: Option<RustcDeprecation>,
-    /// `None` means the function is stable but needs to be allowed by the
-    /// `min_const_fn` feature
+    /// `None` means the function is stable but needs to be a stable const fn, too
     /// `Some` contains the feature gate required to be able to use the function
     /// as const fn
     pub const_stability: Option<Symbol>,
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 3b4e00a515d..24ee2464055 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -40,16 +40,6 @@ use symbol::{keywords, Symbol};
 use std::{env};
 
 macro_rules! set {
-    // The const_fn feature also enables the min_const_fn feature, because `min_const_fn` allows
-    // the declaration `const fn`, but the `const_fn` feature gate enables things inside those
-    // functions that we do not want to expose to the user for now.
-    (const_fn) => {{
-        fn f(features: &mut Features, _: Span) {
-            features.const_fn = true;
-            features.min_const_fn = true;
-        }
-        f as fn(&mut Features, Span)
-    }};
     ($field: ident) => {{
         fn f(features: &mut Features, _: Span) {
             features.$field = true;
@@ -219,9 +209,6 @@ declare_features! (
     // Allows the definition of `const fn` functions with some advanced features.
     (active, const_fn, "1.2.0", Some(24111), None),
 
-    // Allows the definition of `const fn` functions.
-    (active, min_const_fn, "1.30.0", Some(53555), None),
-
     // Allows let bindings and destructuring in `const fn` functions and constants.
     (active, const_let, "1.22.1", Some(48821), None),
 
@@ -690,6 +677,8 @@ declare_features! (
     (accepted, extern_prelude, "1.30.0", Some(44660), None),
     // Parentheses in patterns
     (accepted, pattern_parentheses, "1.31.0", Some(51087), None),
+    // Allows the definition of `const fn` functions.
+    (accepted, min_const_fn, "1.31.0", Some(53555), None),
 );
 
 // If you change this, please modify src/doc/unstable-book as well. You must
@@ -1807,9 +1796,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                 if header.asyncness.is_async() {
                     gate_feature_post!(&self, async_await, span, "async fn is unstable");
                 }
-                if header.constness.node == ast::Constness::Const {
-                    gate_feature_post!(&self, min_const_fn, span, "const fn is unstable");
-                }
                 // stability of const fn methods are covered in
                 // visit_trait_item and visit_impl_item below; this is
                 // because default methods don't pass through this
@@ -1864,11 +1850,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
         }
 
         match ii.node {
-            ast::ImplItemKind::Method(ref sig, _) => {
-                if sig.header.constness.node == ast::Constness::Const {
-                    gate_feature_post!(&self, min_const_fn, ii.span, "const fn is unstable");
-                }
-            }
+            ast::ImplItemKind::Method(..) => {}
             ast::ImplItemKind::Existential(..) => {
                 gate_feature_post!(
                     &self,