Auto merge of #11892 - y21:actually_rename_doc_for_real_this_time, r=Manishearth
rename `DocMarkdown` pass to `Documentation` Followup of #11801 This was discussed in todays meeting: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Meeting.202023-11-28/near/404667082 Decided to go with `Documentation`, because this would also make it consistent with how `Attributes` is named in `attrs.rs` (and it also sounds good). changelog: none
This commit is contained in:
commit
91c5653a47
@ -305,15 +305,14 @@
|
|||||||
"suspicious usage of (outer) doc comments"
|
"suspicious usage of (outer) doc comments"
|
||||||
}
|
}
|
||||||
|
|
||||||
#[expect(clippy::module_name_repetitions)]
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct DocMarkdown {
|
pub struct Documentation {
|
||||||
valid_idents: FxHashSet<String>,
|
valid_idents: FxHashSet<String>,
|
||||||
in_trait_impl: bool,
|
in_trait_impl: bool,
|
||||||
check_private_items: bool,
|
check_private_items: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DocMarkdown {
|
impl Documentation {
|
||||||
pub fn new(valid_idents: &[String], check_private_items: bool) -> Self {
|
pub fn new(valid_idents: &[String], check_private_items: bool) -> Self {
|
||||||
Self {
|
Self {
|
||||||
valid_idents: valid_idents.iter().cloned().collect(),
|
valid_idents: valid_idents.iter().cloned().collect(),
|
||||||
@ -323,7 +322,7 @@ pub fn new(valid_idents: &[String], check_private_items: bool) -> Self {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_lint_pass!(DocMarkdown => [
|
impl_lint_pass!(Documentation => [
|
||||||
DOC_LINK_WITH_QUOTES,
|
DOC_LINK_WITH_QUOTES,
|
||||||
DOC_MARKDOWN,
|
DOC_MARKDOWN,
|
||||||
MISSING_SAFETY_DOC,
|
MISSING_SAFETY_DOC,
|
||||||
@ -334,7 +333,7 @@ pub fn new(valid_idents: &[String], check_private_items: bool) -> Self {
|
|||||||
SUSPICIOUS_DOC_COMMENTS
|
SUSPICIOUS_DOC_COMMENTS
|
||||||
]);
|
]);
|
||||||
|
|
||||||
impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
|
impl<'tcx> LateLintPass<'tcx> for Documentation {
|
||||||
fn check_crate(&mut self, cx: &LateContext<'tcx>) {
|
fn check_crate(&mut self, cx: &LateContext<'tcx>) {
|
||||||
let attrs = cx.tcx.hir().attrs(hir::CRATE_HIR_ID);
|
let attrs = cx.tcx.hir().attrs(hir::CRATE_HIR_ID);
|
||||||
check_attrs(cx, &self.valid_idents, attrs);
|
check_attrs(cx, &self.valid_idents, attrs);
|
||||||
|
@ -747,7 +747,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
|
|||||||
avoid_breaking_exported_api,
|
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(neg_multiply::NegMultiply));
|
||||||
store.register_late_pass(|_| Box::new(let_if_seq::LetIfSeq));
|
store.register_late_pass(|_| Box::new(let_if_seq::LetIfSeq));
|
||||||
store.register_late_pass(|_| Box::new(mixed_read_write_in_expression::EvalOrderDependence));
|
store.register_late_pass(|_| Box::new(mixed_read_write_in_expression::EvalOrderDependence));
|
||||||
|
Loading…
Reference in New Issue
Block a user