Remove doc(include)

This commit is contained in:
Joshua Nelson 2021-05-18 21:46:41 -04:00
parent 6c27482115
commit 390893c600
2 changed files with 3 additions and 19 deletions

View File

@ -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;
@ -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<'_>,
@ -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,

View File

@ -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() {}