-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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] paths
is inconsistent and questionably useful
#93522
Comments
I was using // lib.rs
mod expr;
pub use expr::Expr;
pub enum Main {
Test,
}
// expr.rs
pub enum Expr {
Test,
} ...will now only have the |
I would be in favor of removing it completely. Handling re-export is very complicated and even if we were to handle them I still don't see how it could distinguiesh between the "real" location and what the "user" might want. It could see be re-introduce later but in the mean time I would be I favor of just removing it. |
@CraftSpider @Enselic I'm planning on submitting a PR to remove |
@Urgau Sounds good to me! I don't use it and don't plan to. |
obi1kenobi/cargo-semver-checks#202 ran into an interesting real-world edge case that might be useful for guiding future work in this area. The affected crate, Here's one of those enums: https://github.com/libp2p/rust-libp2p/blob/1c2712c1bc288dc608aaec5fc3458b0d07181feb/protocols/dcutr/src/protocol/outbound.rs#L118 Currently, rustdoc JSON v22 and v23 do not include the re-exported items in They do however include the renaming re-export:
The obi1kenobi/cargo-semver-checks#202 is caused by the difficulty in matching up "the same item" across two different versions. Our current approach fails since it doesn't account for renames, and ends up comparing two enums that happen to be defined with the same name but are "not the same enum" across versions. This is certainly a bug in |
Problem:
Currently, the items
paths
includes is just the list of paths used in the rustdoc cache. This is implementation-dependent, misses some items that should possibly be included such as re-export source items, and generally imperfect.Solution:
paths
inclusion should be standardized, and separated from the internal cache implementation.The text was updated successfully, but these errors were encountered: