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 7
7
8
8
use clippy_utils:: attrs:: is_doc_hidden;
9
9
use clippy_utils:: diagnostics:: span_lint;
10
- use if_chain:: if_chain;
11
- use rustc_ast:: ast:: { self , MetaItem , MetaItemKind } ;
10
+ use rustc_ast:: ast;
12
11
use rustc_hir as hir;
13
12
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
14
13
use rustc_middle:: ty;
@@ -56,20 +55,6 @@ impl MissingDoc {
56
55
* self . doc_hidden_stack . last ( ) . expect ( "empty doc_hidden_stack" )
57
56
}
58
57
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
-
73
58
fn check_missing_docs_attrs (
74
59
& self ,
75
60
cx : & LateContext < ' _ > ,
@@ -95,7 +80,7 @@ impl MissingDoc {
95
80
96
81
let has_doc = attrs
97
82
. iter ( )
98
- . any ( |a| a. doc_str ( ) . is_some ( ) || Self :: has_include ( a . meta ( ) ) ) ;
83
+ . any ( |a| a. doc_str ( ) . is_some ( ) ) ;
99
84
if !has_doc {
100
85
span_lint (
101
86
cx,
Original file line number Diff line number Diff line change 1
1
#![ warn( clippy:: missing_docs_in_private_items) ]
2
- #![ feature( external_doc) ]
3
- #![ doc( include = "../../README.md" ) ]
2
+ #![ doc = include_str ! ( "../../README.md" ) ]
4
3
5
4
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments