Skip to content

Commit 3676227

Browse files
nnethercoteGuillaumeGomez
authored and
gitbot
committed
Remove rustc::existing_doc_keyword lint.
`CheckAttrVisitor::check_doc_keyword` checks `#[doc(keyword = "..")]` attributes to ensure they are on an empty module, and that the value is a non-empty identifier. The `rustc::existing_doc_keyword` lint checks these attributes to ensure that the value is the name of a keyword. It's silly to have two different checking mechanisms for these attributes. This commit does the following. - Changes `check_doc_keyword` to check that the value is the name of a keyword (avoiding the need for the identifier check, which removes a dependency on `rustc_lexer`). - Removes the lint. - Updates tests accordingly. There is one hack: the `SelfTy` FIXME case used to used to be handled by disabling the lint, but now is handled with a special case in `is_doc_keyword`. That hack will go away if/when the FIXME is fixed. Co-Authored-By: Guillaume Gomez <[email protected]>
1 parent 10055d3 commit 3676227

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

std/src/keyword_docs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,10 +1263,10 @@ mod return_keyword {}
12631263
/// [Reference]: ../reference/items/associated-items.html#methods
12641264
mod self_keyword {}
12651265

1266-
// FIXME: Once rustdoc can handle URL conflicts on case insensitive file systems, we can remove the
1267-
// three next lines and put back: `#[doc(keyword = "Self")]`.
1266+
// FIXME: Once rustdoc can handle URL conflicts on case insensitive file systems, we can replace
1267+
// these two lines with `#[doc(keyword = "Self")]` and update `is_doc_keyword` in
1268+
// `CheckAttrVisitor`.
12681269
#[doc(alias = "Self")]
1269-
#[allow(rustc::existing_doc_keyword)]
12701270
#[doc(keyword = "SelfTy")]
12711271
//
12721272
/// The implementing type within a [`trait`] or [`impl`] block, or the current type within a type

std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@
251251
#![allow(explicit_outlives_requirements)]
252252
#![allow(unused_lifetimes)]
253253
#![allow(internal_features)]
254-
#![deny(rustc::existing_doc_keyword)]
255254
#![deny(fuzzy_provenance_casts)]
256255
#![deny(unsafe_op_in_unsafe_fn)]
257256
#![allow(rustdoc::redundant_explicit_links)]

0 commit comments

Comments
 (0)