Skip to content

Commit b9b11a0

Browse files
petrochenkovnnethercote
authored andcommitted
rustc_span: Remove Symbol::is_doc_keyword.
The check in rustdoc using it is artificial and not helpful.
1 parent 36b0d7e commit b9b11a0

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,11 +1556,6 @@ impl Symbol {
15561556
self == kw::Try
15571557
}
15581558

1559-
/// Used for sanity checking rustdoc keyword sections.
1560-
pub fn is_doc_keyword(self) -> bool {
1561-
self <= kw::Union
1562-
}
1563-
15641559
/// A keyword or reserved identifier that can be used as a path segment.
15651560
pub fn is_path_segment_keyword(self) -> bool {
15661561
self == kw::Super

src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,8 @@ impl Clean<ExternalCrate> for CrateNum {
170170
for attr in attrs.lists(sym::doc) {
171171
if let Some(v) = attr.value_str() {
172172
if attr.has_name(sym::keyword) {
173-
if v.is_doc_keyword() {
174-
keyword = Some(v.to_string());
175-
break;
176-
}
177-
// FIXME: should warn on unknown keywords?
173+
keyword = Some(v.to_string());
174+
break;
178175
}
179176
}
180177
}

0 commit comments

Comments
 (0)