]> git.lizzy.rs Git - rust.git/commitdiff
Put doc keyword behind feature flag
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 2 Jun 2018 22:45:49 +0000 (00:45 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 4 Jun 2018 07:52:31 +0000 (09:52 +0200)
src/libstd/lib.rs
src/libsyntax/feature_gate.rs
src/test/rustdoc/keyword.rs

index c576245edb755c1d271fbf04f431951efe50a265..8266cec5139f966267bd012007683596c8fe6fb6 100644 (file)
 #![cfg_attr(test, feature(update_panic_count))]
 #![cfg_attr(windows, feature(used))]
 #![feature(doc_alias)]
+#![feature(doc_keyword)]
 #![feature(float_internals)]
 #![feature(panic_info_message)]
 #![cfg_attr(not(stage0), feature(panic_implementation))]
index 7349745fefea100b1b9b1c6de4739e7ee089dd49..51788b6063a333c5700d00a6c24b94a24cb0eefa 100644 (file)
@@ -476,8 +476,12 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     // 'a: { break 'a; }
     (active, label_break_value, "1.28.0", Some(48594), None),
 
+
     // #[panic_implementation]
     (active, panic_implementation, "1.28.0", Some(44489), None),
+
+    // #[doc(keyword = "...")]
+    (active, doc_keyword, "1.28.0", Some(51315), None),
 );
 
 declare_features! (
@@ -1506,6 +1510,10 @@ fn visit_attribute(&mut self, attr: &ast::Attribute) {
                     gate_feature_post!(&self, doc_alias, attr.span,
                         "#[doc(alias = \"...\")] is experimental"
                     );
+                } else if content.iter().any(|c| c.check_name("keyword")) {
+                    gate_feature_post!(&self, doc_keyword, attr.span,
+                        "#[doc(keyword = \"...\")] is experimental"
+                    );
                 }
             }
         }
index 5682fce780856b89fda154b9bbfd749b2b2edd4c..06ebf15d364574c5b1b03c817c921ef74cdf6a62 100644 (file)
@@ -10,6 +10,8 @@
 
 #![crate_name = "foo"]
 
+#![feature(doc_keyword)]
+
 // @has foo/index.html '//h2[@id="keywords"]' 'Keywords'
 // @has foo/index.html '//a[@href="keyword.match.html"]' 'match'
 // @has foo/keyword.match.html '//a[@class="keyword"]' 'match'