RS.CLIPPY.REDUNDANT_PUB_CRATE

Using `pub(crate)` visibility on items that are not crate visible due to the visibility of the module that contains them.

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: redundant_pub_crate. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for items declared pub(crate) that are not crate visible because they are inside a private module.

Why is this bad?

Writing pub(crate) is misleading when it's redundant due to the parent module's visibility.

Example

mod internal {
    pub(crate) fn internal_fn() { }
}

This function is not visible outside the module and it can be declared with pub or private visibility

mod internal {
    pub fn internal_fn() { }
}