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

Rustdoc: exposes private modules that reexport functions #10810

Closed
mstewartgallus opened this issue Dec 5, 2013 · 1 comment
Closed

Rustdoc: exposes private modules that reexport functions #10810

mstewartgallus opened this issue Dec 5, 2013 · 1 comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@mstewartgallus
Copy link
Contributor

The following code makes rustdoc show the module to the outside world when the module should be private.

#[crate_type = "lib"];

mod should_not_be_visible_outside_of_lib {
    pub use self::context::function_exposing_bug;

    mod context {
        pub fn function_exposing_bug() {}
    }
}
@alexcrichton
Copy link
Member

Closed by #11391

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 2, 2023
needless_else: new lint to check for empty `else` clauses

Empty `else` clauses are useless. They happen in the wild and are not linted yet: https://github.com/uutils/coreutils/pull/4880/files

`else` clauses containing or preceded by comments are not linted as the comments might be important.

changelog: [`needless_else`]: new lint
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 2, 2023
Ignore `#[cfg]`'d out code in `needless_else`

changelog: none (same release as rust-lang#10810)

`#[cfg]` making things fun once more

This lead me to think about macro calls that expand to nothing as well, but apparently they produce an empty stmt in the AST so are already handled, added a test for that

r? `@llogiq`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants