RS.CLIPPY.PUB_WITH_SHORTHAND

Disallows usage of `pub(<loc>)`, without `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_with_shorthand. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for usage of pub(<loc>) with in.

Why restrict this?

Consistency. Use it or don't, just be consistent about it.

Also see the pub_without_shorthand lint for an alternative.

Example

pub(super) type OptBox<T> = Option<Box<T>>;

Use instead:

pub(in super) type OptBox<T> = Option<Box<T>>;