Skip to content

Commit

Permalink
Remove doc(include)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Jun 4, 2021
1 parent 6c27482 commit 390893c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
19 changes: 2 additions & 17 deletions clippy_lints/src/missing_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

use clippy_utils::attrs::is_doc_hidden;
use clippy_utils::diagnostics::span_lint;
use if_chain::if_chain;
use rustc_ast::ast::{self, MetaItem, MetaItemKind};
use rustc_ast::ast;
use rustc_hir as hir;
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::ty;
Expand Down Expand Up @@ -56,20 +55,6 @@ impl MissingDoc {
*self.doc_hidden_stack.last().expect("empty doc_hidden_stack")
}

fn has_include(meta: Option<MetaItem>) -> bool {
if_chain! {
if let Some(meta) = meta;
if let MetaItemKind::List(list) = meta.kind;
if let Some(meta) = list.get(0);
if let Some(name) = meta.ident();
then {
name.name == sym::include
} else {
false
}
}
}

fn check_missing_docs_attrs(
&self,
cx: &LateContext<'_>,
Expand All @@ -95,7 +80,7 @@ impl MissingDoc {

let has_doc = attrs
.iter()
.any(|a| a.doc_str().is_some() || Self::has_include(a.meta()));
.any(|a| a.doc_str().is_some());
if !has_doc {
span_lint(
cx,
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/missing-doc-crate.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![warn(clippy::missing_docs_in_private_items)]
#![feature(external_doc)]
#![doc(include = "../../README.md")]
#![doc = include_str!("../../README.md")]

fn main() {}

0 comments on commit 390893c

Please sign in to comment.