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 Produces dangling ID's when pub useing #[doc(hidden)] items. #106379

Closed
Tracked by #106435
aDotInTheVoid opened this issue Jan 2, 2023 · 1 comment · Fixed by #106538
Closed
Tracked by #106435

Rustdoc JSON Produces dangling ID's when pub useing #[doc(hidden)] items. #106379

aDotInTheVoid opened this issue Jan 2, 2023 · 1 comment · Fixed by #106538
Assignees
Labels
A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@aDotInTheVoid
Copy link
Member

aDotInTheVoid commented Jan 2, 2023

#![feature(no_core)]
#![no_core]

mod repeat_n {
    #[doc(hidden)]
    pub struct RepeatN {}
}

pub use repeat_n::RepeatN;

Errors with

---- [rustdoc-json] src/test/rustdoc-json/reexport/pub_use_doc_hidden.rs stdout ----

error: jsondoclint failed!
status: exit status: 1
command: "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/stage0-tools-bin/jsondoclint" "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/reexport/pub_use_doc_hidden/pub_use_doc_hidden.json"
stdout: none
--- stderr -------------------------------
0:2:1571 not in index or paths, but refered to at '$.index["0:3"].inner.id'
Error: Errors validating json /home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/reexport/pub_use_doc_hidden/pub_use_doc_hidden.json
------------------------------------------

and produced

{
  "crate_version": null,
  "external_crates": {},
  "format_version": 23,
  "includes_private": false,
  "index": {
    "0:0:1572": {
      "crate_id": 0,
      "docs": null,
      "id": "0:0:1572",
      "inner": {"is_crate": true, "is_stripped": false, "items": ["0:3"]},
      "kind": "module",
      "links": {},
      "name": "pub_use_doc_hidden"
    },
    "0:3": {
      "crate_id": 0,
      "docs": null,
      "id": "0:3",
      "inner": {"glob": false, "id": "0:2:1571", "name": "RepeatN", "source": "repeat_n::RepeatN"},
      "kind": "import",
      "links": {},
      "name": null
    }
  },
  "paths": {"0:0:1572": {"crate_id": 0, "kind": "module", "path": ["pub_use_doc_hidden"]}},
  "root": "0:0:1572"
}

HTML gets this right and doesn't output anything:

image

@aDotInTheVoid aDotInTheVoid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-json Area: Rustdoc JSON backend labels Jan 2, 2023
@aDotInTheVoid
Copy link
Member Author

@rustbot claim

bors added a commit to rust-lang-ci/rust that referenced this issue Jan 7, 2023
…r=notriddle

rustdoc: Strip imports of items which are `#[doc(hidden)]`

Closes rust-lang#106379
@bors bors closed this as completed in ff46d11 Jan 7, 2023
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 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.

1 participant