Merge commit '37f4fbb929' into clippy-subtree-update

This commit is contained in:
Philipp Krones 2024-07-25 18:29:17 +02:00
parent 6d674685ae
commit 4e6851e50b
291 changed files with 4890 additions and 5205 deletions

View file

@ -1,4 +1,5 @@
use clippy_config::types::PubUnderscoreFieldsBehaviour;
use clippy_config::Conf;
use clippy_utils::attrs::is_doc_hidden;
use clippy_utils::diagnostics::span_lint_hir_and_then;
use clippy_utils::is_path_lang_item;
@ -42,10 +43,18 @@ declare_clippy_lint! {
}
pub struct PubUnderscoreFields {
pub behavior: PubUnderscoreFieldsBehaviour,
behavior: PubUnderscoreFieldsBehaviour,
}
impl_lint_pass!(PubUnderscoreFields => [PUB_UNDERSCORE_FIELDS]);
impl PubUnderscoreFields {
pub fn new(conf: &'static Conf) -> Self {
Self {
behavior: conf.pub_underscore_fields_behavior,
}
}
}
impl<'tcx> LateLintPass<'tcx> for PubUnderscoreFields {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
// This lint only pertains to structs.