-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE on rustdoc-json with re-export due to ID collision #80664
Comments
@rustbot modify labels: -T-compiler +T-rustdoc |
I still think the right fix for this is for JSON to have its own IDs that are separate from DefIds. The main issue is that you want the functionality of both HirIds and DefIds, basically, and some things with the same DefId have different HirIds. You can't just use HirIds because they're only available for the current crate; you wouldn't be able to serialize things from other crates. |
@rustbot modify labels +A-rustdoc-json |
…ftSpider Rustdoc Json: Add tests for Reexports, and improve jsondocck The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests. Notably does not have the case from rust-lang#80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything. Improves rust-lang#81359 cc `@CraftSpider` r? `@jyn514` `@rustbot` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json
…ftSpider Rustdoc Json: Add tests for Reexports, and improve jsondocck The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests. Notably does not have the case from rust-lang#80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything. Improves rust-lang#81359 cc ``@CraftSpider`` r? ``@jyn514`` ``@rustbot`` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json
…ftSpider Rustdoc Json: Add tests for Reexports, and improve jsondocck The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests. Notably does not have the case from rust-lang#80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything. Improves rust-lang#81359 cc ```@CraftSpider``` r? ```@jyn514``` ```@rustbot``` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json
No, it's not an ID problem, as rust/src/librustdoc/formats/renderer.rs Lines 87 to 94 in 338647d
where we currently render the children of stripped items. Changing this fixes the problem for json (gives expected output for this test case, and all existing test cases pass), but breaks the html is ways I do not understand. Specificly these tests fail
The fix is to add an item to |
I looked into why the HTML still documents the stripped items - AFAICT it doesn't seem to be necessary as long as the item is inlined, and all The file being generated in the private module is just a redirect to the inlined file. It looks like this was added in 7ec6df5 (part of #14513) because rustdoc doesn't know inlining decisions it made in other crates 🤦 presumably it needs the HIR available or something like that. I don't think this should affect JSON at all because it doesn't have links or any concept of inlining, right? The primary key is just the DefId? |
…doc, r=jyn514 [rustdoc] Don't document stripped items in JSON renderer. Fixes rust-lang#80664, see [my comment there](rust-lang#80664 (comment)) for why Note that we already do something similar in `convert_item`: https://github.com/rust-lang/rust/blob/bb4cdf8ec034dca5c056ec9295f38062e5b7e871/src/librustdoc/json/conversions.rs#L28-L31 `@rustbot` modify labels: +T-rustdoc +A-rustdoc-json r? `@jyn514` cc `@CraftSpider`
…doc, r=jyn514 [rustdoc] Don't document stripped items in JSON renderer. Fixes rust-lang#80664, see [my comment there](rust-lang#80664 (comment)) for why Note that we already do something similar in `convert_item`: https://github.com/rust-lang/rust/blob/bb4cdf8ec034dca5c056ec9295f38062e5b7e871/src/librustdoc/json/conversions.rs#L28-L31 ``@rustbot`` modify labels: +T-rustdoc +A-rustdoc-json r? ``@jyn514`` cc ``@CraftSpider``
This assertion is still triggered if you try to document libcore with JSON output.
|
Code
Meta
Invoke with
rustdoc broke.rs --output-format json
rustdoc --version --verbose
:Error output
Backtrace
Working variants
json
json
json
Whats happening
The panic is here
rust/src/librustdoc/json/mod.rs
Lines 163 to 169 in db69136
inner::Public
is being added to the index when is shouldn't (I think), so whenReexported
is added, the IDs colide, and we bail.I think the solution is that
inner::Public
should never have been added into the index.The text was updated successfully, but these errors were encountered: