about summary refs log tree commit diff
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2017-10-31 21:39:32 +0100
committerest31 <MTest31@outlook.com>2017-10-31 21:39:32 +0100
commit911e476cbee77e4ddd494122c99feb928f3b739b (patch)
tree81b1c1f402fb39410247a68d44260a12a9c2544d
parent8b22e70b2de5152db3b0c53cfa16eb96b0b9e40e (diff)
downloadrust-911e476cbee77e4ddd494122c99feb928f3b739b.tar.gz
rust-911e476cbee77e4ddd494122c99feb928f3b739b.zip
Tidy: track rustc_const_unstable feature gates as well
This is important for the unstable book stub generation.
-rw-r--r--src/tools/tidy/src/features.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index a2a264490a1..671798b28e1 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -351,6 +351,26 @@ fn map_lib_features(base_src_path: &Path,
                 }
             }
             becoming_feature = None;
+            if line.contains("rustc_const_unstable(") && line.contains("#[") {
+                // const fn features are handled specially
+                let feature_name = match find_attr_val(line, "feature") {
+                    Some(name) => name,
+                    None => err!("malformed stability attribute"),
+                };
+                let feature = Feature {
+                    level: Status::Unstable,
+                    since: "None".to_owned(),
+                    has_gate_test: false,
+                    // Whether there is a common tracking issue
+                    // for these feature gates remains an open question
+                    // https://github.com/rust-lang/rust/issues/24111#issuecomment-340283184
+                    // But we take 24111 otherwise they will be shown as
+                    // "internal to the compiler" which they are not.
+                    tracking_issue: Some(24111),
+                };
+                mf(Ok((feature_name, feature)), file, i + 1);
+                continue;
+            }
             let level = if line.contains("[unstable(") {
                 Status::Unstable
             } else if line.contains("[stable(") {