]> git.lizzy.rs Git - rust.git/commitdiff
Tidy: track rustc_const_unstable feature gates as well
authorest31 <MTest31@outlook.com>
Tue, 31 Oct 2017 20:39:32 +0000 (21:39 +0100)
committerest31 <MTest31@outlook.com>
Tue, 31 Oct 2017 20:39:32 +0000 (21:39 +0100)
This is important for the unstable book stub generation.

src/tools/tidy/src/features.rs

index a2a264490a141848c2289953db12b9d3ef658f9e..671798b28e19a27952a762fd00e0233093e86c5f 100644 (file)
@@ -351,6 +351,26 @@ macro_rules! err {
                 }
             }
             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(") {