File tree Expand file tree Collapse file tree 2 files changed +3
-19
lines changed Expand file tree Collapse file tree 2 files changed +3
-19
lines changed Original file line number Diff line number Diff line change 77
88use clippy_utils:: attrs:: is_doc_hidden;
99use clippy_utils:: diagnostics:: span_lint;
10- use if_chain:: if_chain;
11- use rustc_ast:: ast:: { self , MetaItem , MetaItemKind } ;
10+ use rustc_ast:: ast;
1211use rustc_hir as hir;
1312use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
1413use rustc_middle:: ty;
@@ -56,20 +55,6 @@ impl MissingDoc {
5655 * self . doc_hidden_stack . last ( ) . expect ( "empty doc_hidden_stack" )
5756 }
5857
59- fn has_include ( meta : Option < MetaItem > ) -> bool {
60- if_chain ! {
61- if let Some ( meta) = meta;
62- if let MetaItemKind :: List ( list) = meta. kind;
63- if let Some ( meta) = list. get( 0 ) ;
64- if let Some ( name) = meta. ident( ) ;
65- then {
66- name. name == sym:: include
67- } else {
68- false
69- }
70- }
71- }
72-
7358 fn check_missing_docs_attrs (
7459 & self ,
7560 cx : & LateContext < ' _ > ,
@@ -95,7 +80,7 @@ impl MissingDoc {
9580
9681 let has_doc = attrs
9782 . iter ( )
98- . any ( |a| a. doc_str ( ) . is_some ( ) || Self :: has_include ( a . meta ( ) ) ) ;
83+ . any ( |a| a. doc_str ( ) . is_some ( ) ) ;
9984 if !has_doc {
10085 span_lint (
10186 cx,
Original file line number Diff line number Diff line change 11#![ warn( clippy:: missing_docs_in_private_items) ]
2- #![ feature( external_doc) ]
3- #![ doc( include = "../../README.md" ) ]
2+ #![ doc = include_str ! ( "../../README.md" ) ]
43
54fn main ( ) { }
You can’t perform that action at this time.
0 commit comments