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

Double reexport of non-public item is not listed as reexport #108679

Closed
Kyuuhachi opened this issue Mar 2, 2023 · 3 comments · Fixed by #108870
Closed

Double reexport of non-public item is not listed as reexport #108679

Kyuuhachi opened this issue Mar 2, 2023 · 3 comments · Fixed by #108870
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Kyuuhachi
Copy link
Contributor

pub mod a {
    mod b {
        pub struct B;
    }
    pub use b::B;
    pub struct A;
}

pub use a::{A, B};

When running cargo doc with the above code, the docs list the following items:

Docs

Crate foo

Re-exports

pub use a::A;

Modules

a

Structs

B

Module foo::a

Structs

A
B

I would expect a::B to be listed as a reexport, not a struct. The way it is now, it looks like foo::B and foo::a::B are different types, which is not the case.

If a::b is made pub, everything looks as it's supposed to.

@rustbot label +T-rustdoc

@Kyuuhachi Kyuuhachi added the C-bug Category: This is a bug. label Mar 2, 2023
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 2, 2023
@GuillaumeGomez
Copy link
Member

It's the intended behaviour. Since the b module is private, pub use b::B is inlining the item into a.

@Kyuuhachi
Copy link
Contributor Author

Yes, but crate::a::B is public, so should it really be inlined a second time?

@GuillaumeGomez GuillaumeGomez reopened this Mar 3, 2023
@GuillaumeGomez
Copy link
Member

Ok sorry I misunderstood what you meant. No, it shouldn't be inlined a second time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants