External Publication
Visit Post

Pre-RFC: `pub(api)` visibility, and static enforcement of crate-internal API boundaries

Rust Internals [Unofficial] April 20, 2026
Source

kornel:

pub(in path) had to have in added because pub(not_a_keyword) was ambiguous (in struct definitions? I don't remember the exact syntax quirk).

I think the ambiguity would be nested tuples: struct TupleStruct(pub (u32, u32), u32). Without in, you can't easily disambiguate between a type path and a module path.

This is not too far removed from the ambiguity that made it hard to use crate as shorthand for pub(crate): struct TupleStruct(crate ::type).

Discussion in the ATmosphere

Loading comments...