Only document reachable APIs with cargo doc - #16603
ojuschugh1 wants to merge 2 commits into
Conversation
12fa44b to
e7d5853
Compare
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| pub_dep = { version = "0.0.1", public = true } | ||
| priv_dep = { version = "0.0.1", public = false } | ||
| priv_dep_with_dep = "0.0.1" | ||
| "#, |
There was a problem hiding this comment.
This is checking the mixed case for direct deps and not transitive deps. Is that intentional or did you meant for these to be indirect?
And what is it we are trying to get out of the mixed test vs other tests added?
There was a problem hiding this comment.
And what is it we are trying to get out of the mixed test vs other tests added?
Could you help me understand the role of this test?
There was a problem hiding this comment.
@ojuschugh1 there are outstanding questions on this
There was a problem hiding this comment.
@ojuschugh1 this is still unaddressed while other work continues
There was a problem hiding this comment.
Sorry for missing this again. It was meant to cover public, private and unannotated deps in one manifest, but the direct part is already covered by doc_direct_deps_always_documented and the transitive part by doc_with_transitive_private_dependency, so it wasn't adding anything. I've dropped it.
There was a problem hiding this comment.
Currently cargo doc generates docs for all transitive dependencies, which creates a lot of noise.
This allows library authors to control their documentation surface by
marking which dependencies are part of their public API.
The reason is that indirect private deps have no impact on the reader of the docs since they cannot be used and this can dramatically speed up documentation builds, especially with packages like windows-sys in a dependency tree
|
I have addressed your comments and feedback, kindly please review it and let me know @epage , after that i will make the commits proper. thanks |
|
@ojuschugh1 Would you mind cleaning up the commits to be atomic? (mentioned in the contributor guide) Atomic commits aren't just for Git history, they make it easier for reviewers to review changes. |
2fd32b8 to
d0ffd36
Compare
d0ffd36 to
a6cc3a8
Compare
a48ae5c to
31b786c
Compare
31b786c to
d327857
Compare
d327857 to
7e57124
Compare
|
Hi @epage , Gentle reminder could you kindly please reivew it, when you get a moment. Thanks |
7e57124 to
5d84a47
Compare
5d84a47 to
07b6c1b
Compare
fe28062 to
6e9b1f3
Compare
cargo doc
6e9b1f3 to
9ccbd9a
Compare
9ccbd9a to
7c20eb2
Compare
This comment has been minimized.
This comment has been minimized.
7c20eb2 to
2df9612
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Hey @epage hope you are doing well. It has been a while since this PR so i thought to fix the remaining comments so that it can closed, could you kindly look into this when you get a moment. Thanks ! |
View all comments
What does this PR try to resolve?
Fixes #2025
Adds support for documenting only direct dependencies when using the public-dependency feature. Currently cargo doc generates docs for all transitive dependencies, which creates a lot of noise. With this change, when
-Zpublic-dependencyis enabled, only direct deps and their public deps get documented.Backward compatible - without the flag everything works as before.