Skip to content
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

Discourage awkward reexports in favor of pub(restricted). #59

Closed
dragostis opened this Issue May 11, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@dragostis
Copy link

dragostis commented May 11, 2017

Instead of having awkward structures like:

my_mod_private/
  stuff/
other_mods_see_private_stuff/

and in lib.rs:

mod my_mod {
    // reexport what needs to be public from my_mod_private
}

we should make use of pub(restricted) (stabilized in 1.18).

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jun 30, 2017

Seems like we need a concrete place where we've done this, and have a concrete pattern to suggest.

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Oct 29, 2017

Thanks! I added a note about pub(restricted) in 2fb6161. For the purpose of the API guidelines this is only about removing things from the public API. I don't want to go into much more detail about advanced use of pub(restricted) because none of that affects the crate's API.

@dtolnay dtolnay closed this Oct 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.