-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: rustdoc json when #[doc(primitive)] mod name is same as primitive name. #102363
Comments
maybe #102321 ? |
The problem is here, where primitives are given the same id as the module they are contained in. rust/src/librustdoc/clean/utils.rs Lines 64 to 71 in 470e518
Instead, they should use an @rustbot claim |
Turns out that isn’t a viable approach, as the whole rustdoc primitve infrastructure assumes that primitives have a defid, which is the one that actually belongs to the module. An alternative approach would be for the json backend to just ignore module labelled #[doc(primitive)]. This would make rustdoc json be slightly inaccurate when documenting core with —document-private-items, but only by loosing mod prim_i32 etc, which i feel is acceptable as they are empty and only exists to help rustdoc. |
Upon further investigation, it turns out that this only occurs is when the name of the primitive is the name of the module. When the prim name != the mod name, everything is fine: We test for this https://github.com/rust-lang/rust/blob/master/src/test/rustdoc-json/primitives/primitive_overloading.rs Given that core/std use different names for the mod/primitve, and Proof that it works fine for core
|
Triage: |
There are already tests for the feature gate's general functionality (which do verify that things work appropriately), and this is just one of those tests executed in a different way. We've effectively agreed we're not going to sweat ICEs when
Closing. |
Code
This is a regression that started happening between
rustdoc 1.66.0-nightly (8b705839c 2022-09-26)
(no ice) andrustdoc 1.66.0-nightly (57ee5cf5a 2022-09-27)
(ice)rustdoc --document-private-items -Zunstable-options --output-format=json
Backtrace
The text was updated successfully, but these errors were encountered: