mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Remove doc(include)
This commit is contained in:
parent
6c27482115
commit
390893c600
@ -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,
|
||||
|
@ -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() {}
|
||||
|
Loading…
Reference in New Issue
Block a user