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 JSON: struct fn missing if re-exported from private mod #102583

Closed
Enselic opened this issue Oct 2, 2022 · 2 comments · Fixed by #103653
Closed

rustdoc JSON: struct fn missing if re-exported from private mod #102583

Enselic opened this issue Oct 2, 2022 · 2 comments · Fixed by #103653
Labels
A-rustdoc-json Area: Rustdoc JSON backend C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Enselic
Copy link
Member

Enselic commented Oct 2, 2022

Step-by-step

  1. Put this in repro.rs:
mod private_mod {
    pub struct S;

    impl S {
        pub fn missing_from_rustdoc_json() {}
    }
}

pub use private_mod::*;
  1. Run rustdoc +nightly-2022-10-02 repro.rs -Zunstable-options -wjson

  2. Check if missing_from_rustdoc_json is in the generated JSON: grep missing_from_rustdoc_json doc/repro.json

Actual result

Item is missing.

Expected result

Item is present.

Remarks

The item is present in the HTML version of the docs (rustdoc +nightly-2022-10-02 repro.rs && open doc/repro/index.html), or in the JSON if private_mod is made pub.

@rustbot labels +A-rustdoc-json +T-rustdoc +C-bug

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 2, 2022
@GuillaumeGomez
Copy link
Member

I have a fix for this, I'll send it in the next hours.

@GuillaumeGomez
Copy link
Member

Opened #103653.

@bors bors closed this as completed in 05ab16b Oct 29, 2022
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
…e-json, r=notriddle

Add missing impl blocks for item reexported from private mod in JSON output

Fixes rust-lang#102583.

Since we don't inline for the JSON output, the impl blocks from private modules are not present when we generate the output. To go around this limitation, in case the impl block doesn't have `#[doc(hidden)]` and is implementing a public item, we don't strip it.

cc `@fmease` `@aDotInTheVoid`
r? `@notriddle`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend 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