-
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
rustdoc --json output format, crate.paths does not contain all items #104651
Comments
Do you have a minimized example of the regression by any chance? |
Due to re-exports, a single item can have many paths. And the path to the "real" item may be inaccessible behind a private mod. To learn about all the paths to an item, you must traverse the items from the root. You must also take into account renames ( If you want to look at (one way) of doing that you can look at https://github.com/Enselic/cargo-public-api/blob/main/public-api/src/item_processor.rs The
|
Hmm, thanks everyone, it seems that there is a way then to retrieve import paths which I am happy with. Closing and will re-open if there are any issues with this. |
Maybe we could provide some methods in the |
That would be very useful indeed, for context I use these to import structures for which I am generating wrappers |
Then please open another issue (linking to this one) with a short example of your problem so we can provide you a function to make it easier. ;) |
@GuillaumeGomez I think you meant to say "the @makspll The "source" for |
Yes absolutely. Sorry, confused the names. |
#76578
Code
Running
$ rustup run nightly-2022-11-20 cargo rustdoc -p [email protected] -- -Zunstable-options --output-format json
generates a json file whose
paths
mapping does not contain many of the internal structures such us:AssetPathId, SourcePathId, HandleId, LabelId etc.
Not sure if this is intended, but without this mapping there is no way as far as I am aware to retrieve the original import paths to these things.
Version it worked on
nightly-2022-08-01
Version with regression
nightly-2022-11-20
The text was updated successfully, but these errors were encountered: