-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 displays private internals of associated constants when reexporting types #99630
Comments
Since you are requiring a stable rustc, one workaround is to move the value of |
To my knowledge, the linked PR does not fix the issue, which occurs when reexporting types. |
Ah, I see ( This issue will be fixed by my open PR #99688. However it is massive and a bit controversial I think, so reviews have stalled. I am still very eager to land it and I just contacted the relevant people so work on the PR can pick up pace again. |
I think it would be good to have a separate hotfix PR to make the behavior in this case match that implemented in #98814, as this is clearly what was intended in the first place. I think it may also be worth noting that there doesn't seem to be anywhere for experimental rustdoc features (I think it is clear that displaying non-trivial constant values is experimental) to live prior to being included in rustdoc proper. Even in nightly, rustc has feature gates, but as far as I'm aware rustdoc has no analogous system. This is further exasperated by the fact that docs.rs uses nightly to build documentation, making nightly rustdoc the de facto production Rust documentation generator. |
We do have some features that change rustdocs behaviour, like EDIT: though it has the downside that it's unlikely to be widely used unless it's something very useful like the cfg-docs. Having changes rollout to new builds on docs.rs quickly probably results in finding and fixing issues much faster than waiting for them to be stabilized. Less people build and thoroughly inspect docs locally. |
types/src/lib.rs
:main/src/lib.rs
:This leaks private fields:
Tested with
cargo clean && cargo +nightly doc
.Note that this also applies to verbose initializers.
This issue was first brought up in #97933. The previous issue was closed due to a hotfix implemented in PR #98814. However, the hotfix fails to handle the case in this issue.
Meta
rustc +nightly --version --verbose
:The text was updated successfully, but these errors were encountered: