@@ -12,11 +12,11 @@ use rustc_middle::ty::{self, GenericArgsRef, Ty as MiddleTy};
1212use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
1313use rustc_span:: Span ;
1414use rustc_span:: hygiene:: { ExpnKind , MacroKind } ;
15- use rustc_span:: symbol:: { Symbol , kw , sym} ;
15+ use rustc_span:: symbol:: sym;
1616use tracing:: debug;
1717
1818use crate :: lints:: {
19- BadOptAccessDiag , DefaultHashTypesDiag , DiagOutOfImpl , LintPassByHand , NonExistentDocKeyword ,
19+ BadOptAccessDiag , DefaultHashTypesDiag , DiagOutOfImpl , LintPassByHand ,
2020 NonGlobImportTypeIrInherent , QueryInstability , QueryUntracked , SpanUseEqCtxtDiag ,
2121 SymbolInternStringLiteralDiag , TyQualified , TykindDiag , TykindKind , TypeIrInherentUsage ,
2222 UntranslatableDiag ,
@@ -375,46 +375,6 @@ impl EarlyLintPass for LintPassImpl {
375375 }
376376}
377377
378- declare_tool_lint ! {
379- /// The `existing_doc_keyword` lint detects use `#[doc()]` keywords
380- /// that don't exist, e.g. `#[doc(keyword = "..")]`.
381- pub rustc:: EXISTING_DOC_KEYWORD ,
382- Allow ,
383- "Check that documented keywords in std and core actually exist" ,
384- report_in_external_macro: true
385- }
386-
387- declare_lint_pass ! ( ExistingDocKeyword => [ EXISTING_DOC_KEYWORD ] ) ;
388-
389- fn is_doc_keyword ( s : Symbol ) -> bool {
390- s <= kw:: Union
391- }
392-
393- impl < ' tcx > LateLintPass < ' tcx > for ExistingDocKeyword {
394- fn check_item ( & mut self , cx : & LateContext < ' _ > , item : & rustc_hir:: Item < ' _ > ) {
395- for attr in cx. tcx . hir ( ) . attrs ( item. hir_id ( ) ) {
396- if !attr. has_name ( sym:: doc) {
397- continue ;
398- }
399- if let Some ( list) = attr. meta_item_list ( ) {
400- for nested in list {
401- if nested. has_name ( sym:: keyword) {
402- let keyword = nested
403- . value_str ( )
404- . expect ( "#[doc(keyword = \" ...\" )] expected a value!" ) ;
405- if is_doc_keyword ( keyword) {
406- return ;
407- }
408- cx. emit_span_lint ( EXISTING_DOC_KEYWORD , attr. span , NonExistentDocKeyword {
409- keyword,
410- } ) ;
411- }
412- }
413- }
414- }
415- }
416- }
417-
418378declare_tool_lint ! {
419379 /// The `untranslatable_diagnostic` lint detects messages passed to functions with `impl
420380 /// Into<{D,Subd}iagMessage` parameters without using translatable Fluent strings.
0 commit comments