Skip to content

Commit 390893c

Browse files
committed
Remove doc(include)
1 parent 6c27482 commit 390893c

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

clippy_lints/src/missing_doc.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
use clippy_utils::attrs::is_doc_hidden;
99
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;
1211
use rustc_hir as hir;
1312
use rustc_lint::{LateContext, LateLintPass, LintContext};
1413
use 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,

tests/ui/missing-doc-crate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::missing_docs_in_private_items)]
2-
#![feature(external_doc)]
3-
#![doc(include = "../../README.md")]
2+
#![doc = include_str!("../../README.md")]
43

54
fn main() {}

0 commit comments

Comments
 (0)