rename DocMarkdown to Documentation

This commit is contained in:
y21 2023-11-28 19:14:37 +01:00
parent e6f33905e8
commit 0565267f37
2 changed files with 5 additions and 6 deletions

View File

@ -305,15 +305,14 @@ declare_clippy_lint! {
"suspicious usage of (outer) doc comments"
}
#[expect(clippy::module_name_repetitions)]
#[derive(Clone)]
pub struct DocMarkdown {
pub struct Documentation {
valid_idents: FxHashSet<String>,
in_trait_impl: bool,
check_private_items: bool,
}
impl DocMarkdown {
impl Documentation {
pub fn new(valid_idents: &[String], check_private_items: bool) -> Self {
Self {
valid_idents: valid_idents.iter().cloned().collect(),
@ -323,7 +322,7 @@ impl DocMarkdown {
}
}
impl_lint_pass!(DocMarkdown => [
impl_lint_pass!(Documentation => [
DOC_LINK_WITH_QUOTES,
DOC_MARKDOWN,
MISSING_SAFETY_DOC,
@ -334,7 +333,7 @@ impl_lint_pass!(DocMarkdown => [
SUSPICIOUS_DOC_COMMENTS
]);
impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
impl<'tcx> LateLintPass<'tcx> for Documentation {
fn check_crate(&mut self, cx: &LateContext<'tcx>) {
let attrs = cx.tcx.hir().attrs(hir::CRATE_HIR_ID);
check_attrs(cx, &self.valid_idents, attrs);

View File

@ -747,7 +747,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
avoid_breaking_exported_api,
))
});
store.register_late_pass(move |_| Box::new(doc::DocMarkdown::new(doc_valid_idents, check_private_items)));
store.register_late_pass(move |_| Box::new(doc::Documentation::new(doc_valid_idents, check_private_items)));
store.register_late_pass(|_| Box::new(neg_multiply::NegMultiply));
store.register_late_pass(|_| Box::new(let_if_seq::LetIfSeq));
store.register_late_pass(|_| Box::new(mixed_read_write_in_expression::EvalOrderDependence));