-
Notifications
You must be signed in to change notification settings - Fork 13.3k
A public fn in a private mod with a private type in its signature #25934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can use You could also write: pub fn bar(_: super::Baz) {
} |
@tomjakubowski, thank you for the response. There are no users of that module as the module is private to the crate. |
There are users of the module inside the crate. I don't mean users in the sense of people using it, just that other pieces of code ("users") are using it. Anyway, it looks like I've internalized some old rules of privacy or something. Whoops. My mistake. |
If a crate has a private module and a private type, the module cannot have a public function whose signature refers to the private type. Here is an illustration:
The public function cannot presumably be qualified as a public-facing part of the crate, and it is not presumably a part of the public API of the crate.
Regards,
Ivan
The text was updated successfully, but these errors were encountered: