Skip to content

Commit ded5c5a

Browse files
Put doc keyword behind feature flag
1 parent f784d5e commit ded5c5a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/libstd/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@
316316
#![cfg_attr(test, feature(update_panic_count))]
317317
#![cfg_attr(windows, feature(used))]
318318
#![feature(doc_alias)]
319+
#![feature(doc_keyword)]
319320
#![feature(float_internals)]
320321
#![feature(panic_info_message)]
321322
#![cfg_attr(not(stage0), feature(panic_implementation))]

src/libsyntax/feature_gate.rs

+8
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,12 @@ declare_features! (
476476
// 'a: { break 'a; }
477477
(active, label_break_value, "1.28.0", Some(48594), None),
478478

479+
479480
// #[panic_implementation]
480481
(active, panic_implementation, "1.28.0", Some(44489), None),
482+
483+
// #[doc(keyword = "...")]
484+
(active, doc_keyword, "1.28.0", Some(51315), None),
481485
);
482486

483487
declare_features! (
@@ -1506,6 +1510,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
15061510
gate_feature_post!(&self, doc_alias, attr.span,
15071511
"#[doc(alias = \"...\")] is experimental"
15081512
);
1513+
} else if content.iter().any(|c| c.check_name("keyword")) {
1514+
gate_feature_post!(&self, doc_keyword, attr.span,
1515+
"#[doc(keyword = \"...\")] is experimental"
1516+
);
15091517
}
15101518
}
15111519
}

src/test/rustdoc/keyword.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#![crate_name = "foo"]
1212

13+
#![feature(doc_keyword)]
14+
1315
// @has foo/index.html '//h2[@id="keywords"]' 'Keywords'
1416
// @has foo/index.html '//a[@href="keyword.match.html"]' 'match'
1517
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match'

0 commit comments

Comments
 (0)