I’m looking into compiler code and sometimes see “crate fn” functions like this https://github.com/rust-lang/rust/blob/f37247f885026d29bf26fd4aed6e9135e4f32ebf/src/libsyntax/parse/mod.rs#L152. Is it the same as “pub(crate) fn”?
Yes, as part of the module impovement, the crate keyword can now be used as a visibilty modifier. It is just a shorter, and confusing in my opinion, syntax for pub(crate) .
crate
pub(crate)
We’re not stabilizing it any time soon though, as it proved controversial.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.