From 831fd783416d9f87ec9308ed56e891d0b1ffdbcd Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Wed, 4 Oct 2017 22:00:22 -0500 Subject: add doc_highlight feature flag and tests --- src/libsyntax/feature_gate.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 97eec3a21e9..9bfb3bdbdb4 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -381,6 +381,8 @@ declare_features! ( (active, doc_cfg, "1.21.0", Some(43781)), // #[doc(masked)] (active, doc_masked, "1.21.0", Some(44027)), + // #[doc(spotlight)] + (active, doc_spotlight, "1.22.0", None), // allow `#[must_use]` on functions and comparison operators (RFC 1940) (active, fn_must_use, "1.21.0", Some(43302)), @@ -1292,6 +1294,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { gate_feature_post!(&self, doc_masked, attr.span, "#[doc(masked)] is experimental" ); + } else if content.iter().any(|c| c.check_name("spotlight")) { + gate_feature_post!(&self, doc_spotlight, attr.span, + "#[doc(spotlight)] is experimental" + ); } } } -- cgit 1.4.1-3-g733a5 From be68d34a7eac8d653f453d7174f30e8ac1f73e62 Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Wed, 4 Oct 2017 22:18:52 -0500 Subject: update links and tracking issue for doc_spotlight --- src/doc/unstable-book/src/language-features/doc-spotlight.md | 7 +++++-- src/libsyntax/feature_gate.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/libsyntax') diff --git a/src/doc/unstable-book/src/language-features/doc-spotlight.md b/src/doc/unstable-book/src/language-features/doc-spotlight.md index 8aca01bb638..8117755fef1 100644 --- a/src/doc/unstable-book/src/language-features/doc-spotlight.md +++ b/src/doc/unstable-book/src/language-features/doc-spotlight.md @@ -1,6 +1,6 @@ # `doc_spotlight` -The tracking issue for this feature is: [TODO] +The tracking issue for this feature is: [#45040] The `doc_spotlight` feature allows the use of the `spotlight` parameter to the `#[doc]` attribute, to "spotlight" a specific trait on the return values of functions. Adding a `#[doc(spotlight)]` @@ -24,4 +24,7 @@ impl MyTrait for MyStruct {} pub fn my_fn() -> MyStruct { MyStruct } ``` -This feature was originally implemented in PR [TODO]. +This feature was originally implemented in PR [#45039]. + +[#45040]: https://github.com/rust-lang/rust/issues/45040 +[#45039]: https://github.com/rust-lang/rust/pull/45039 diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 9bfb3bdbdb4..df75e033ab4 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -382,7 +382,7 @@ declare_features! ( // #[doc(masked)] (active, doc_masked, "1.21.0", Some(44027)), // #[doc(spotlight)] - (active, doc_spotlight, "1.22.0", None), + (active, doc_spotlight, "1.22.0", Some(45040)), // allow `#[must_use]` on functions and comparison operators (RFC 1940) (active, fn_must_use, "1.21.0", Some(43302)), -- cgit 1.4.1-3-g733a5