-
Notifications
You must be signed in to change notification settings - Fork 13k
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] Partially remove paths
and introduce external_index
#103085
Conversation
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing |
While I agree that the current situation with An alternative would be to give all publicly accessible paths to an item, but it turns out this is impossible in the general case, as some items can have an infinite number of paths, some of which are infinitely long😱 |
What about we keep |
Yes |
Yikes! Excellent and terrifying example. This feels like it might be worth a lint in clippy? It wasn't obvious to me that this can happen, and I wouldn't be surprised if many tools ( |
|
e864f6c
to
99281fd
Compare
80bc412
to
331a0d9
Compare
…au,GuillaumeGomez rustdoc-json-types: Improve ItemSummary::path docs Somewhat inspired by the doc changes from rust-lang#103085 (cc `@Urgau)` r? `@GuillaumeGomez`
…au,GuillaumeGomez rustdoc-json-types: Improve ItemSummary::path docs Somewhat inspired by the doc changes from rust-lang#103085 (cc ``@Urgau)`` r? ``@GuillaumeGomez``
Introduce a new `external_index` that only contains a `ExternalItem` struct from the previous `ItemSummary`. This "new" index only contains external item and is only here so that IDs continue to referring to an "item". A previous version of this patch also removed `path` but at least until rust-lang#99513 is fixed it is unfortunately still required (as a workaround).
331a0d9
to
5c9982d
Compare
Two Comments:
|
The end goal was to completely remove the
Note that |
☔ The latest upstream changes (presumably #106386) made this pull request unmergeable. Please resolve the merge conflicts. |
From
[rustdoc-json] paths is inconsistent and questionably useful
:To solve this issue this PR introduce a new
external_index
that only contains aExternalItem
struct from the previousItemSummary
. This "new" index only contains external item and is here so that no ID are not dangling and to still provide a minimum of informations to those external IDs (crate_id, name, kind).This PR also renamepath
toname
(fromExternalItem
) because it's not clear at all whatpath
represent (is it one of the public paths but which one or is it a private one but why) so to simplify all this we will now just give the first external name of the item.r? @aDotInTheVoid
cc @Enselic