From ded5c5a9eeb83ea7ec3c572a601afaaca6a3d9e6 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 3 Jun 2018 00:45:49 +0200 Subject: [PATCH] Put doc keyword behind feature flag --- src/libstd/lib.rs | 1 + src/libsyntax/feature_gate.rs | 8 ++++++++ src/test/rustdoc/keyword.rs | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index c576245edb7..8266cec5139 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -316,6 +316,7 @@ #![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))] diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 7349745fefe..51788b6063a 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -476,8 +476,12 @@ declare_features! ( // '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 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { 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" + ); } } } diff --git a/src/test/rustdoc/keyword.rs b/src/test/rustdoc/keyword.rs index 5682fce7808..06ebf15d364 100644 --- a/src/test/rustdoc/keyword.rs +++ b/src/test/rustdoc/keyword.rs @@ -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'