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 linking to foreign methods #106378

Open
Tracked by #106697
aDotInTheVoid opened this issue Jan 2, 2023 · 1 comment
Open
Tracked by #106697
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name 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

#![feature(intra_doc_pointers)]

//! [`read`][pointer::read]

Errors with

---- [rustdoc-json] src/test/rustdoc-json/intra-doc-links/pointer_method.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/intra-doc-links/pointer_method/pointer_method.json"
stdout: none
--- stderr -------------------------------
2:2017:1833 not in index or paths, but refered to at '$.index["0:0:1571"].links["pointer::read"]'
Error: Errors validating json /home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/intra-doc-links/pointer_method/pointer_method.json
------------------------------------------

And produces

  "0:0:1571": {
      "crate_id": 0,
      "docs": "[`read`][pointer::read]",
      "id": "0:0:1571",
      "inner": {"is_crate": true, "is_stripped": false, "items": []},
      "kind": "module",
      "links": {"pointer::read": "2:2017:1833"},
      "name": "pointer_method"
    }
@aDotInTheVoid aDotInTheVoid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-rustdoc-json Area: Rustdoc JSON backend labels Jan 2, 2023
@aDotInTheVoid
Copy link
Member Author

Turns out the root cause is linking to methods on foreign items, and not to do with pointer (or even primitive) code.

//! [int max][i32::max]
//! [vec new][Vec::new]

Errors with

---- [rustdoc-json] src/test/rustdoc-json/intra-doc-links/prim_method.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/intra-doc-links/prim_method/prim_method.json"
stdout: none
--- stderr -------------------------------
2:2323:1834 not in index or paths, but refered to at '$.index["0:0:1572"].links["i32::max"]'
5:6414:911 not in index or paths, but refered to at '$.index["0:0:1572"].links["Vec::new"]'
Error: Errors validating json /home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/intra-doc-links/prim_method/prim_method.json
------------------------------------------

@aDotInTheVoid aDotInTheVoid changed the title Rustdoc JSON doesn't work with intra_doc_pointers Rustdoc JSON produces dangling ID's when linking to foreign methods Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name 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

No branches or pull requests

1 participant