RS.CLIPPY.PUB_WITHOUT_SHORTHAND
Disallows usage of `pub(in <loc>)` with `in`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: pub_without_shorthand. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for usage of pub(<loc>) without in.
Note: As you cannot write a module's path in pub(<loc>), this will only trigger on
pub(super) and the like.
Why restrict this?
Consistency. Use it or don't, just be consistent about it.
Also see the pub_with_shorthand lint for an alternative.
Example
pub(in super) type OptBox<T> = Option<Box<T>>;
Use instead:
pub(super) type OptBox<T> = Option<Box<T>>;