The Wayback Machine - https://web.archive.org/web/20201228171026/https://github.com/rust-lang/reference/pull/758
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

remove redundant `public` #758

Open
wants to merge 1 commit into
base: master
from
Open

Conversation

@king6cong
Copy link
Contributor

@king6cong king6cong commented Feb 12, 2020

No description provided.

@Centril
Copy link
Contributor

@Centril Centril commented Feb 13, 2020

I'm not sure this is redundant as:

pub use foo::private;

mod foo {
    fn private() {}
}

results in an error.

@king6cong
Copy link
Contributor Author

@king6cong king6cong commented Feb 13, 2020

@Centril
As in https://doc.rust-lang.org/stable/reference/visibility-and-privacy.html#re-exporting-and-visibility

pub use self::implementation::api;

mod implementation {
    pub mod api {
        pub fn f() {}
    }
}

Although fn f has pub vis itself, implementation::api::f is private to extern crates, and reexport makes it accessible to extern crates. I don’t know if this is a public name as mentioned here.

@Centril Centril requested a review from ehuss Feb 17, 2020
@Havvy
Copy link
Collaborator

@Havvy Havvy commented Nov 5, 2020

That example is covered by "even a definition with a private canonical path", as far as I can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.