Hide nonlocal doc(hidden) types and impls from "the following other types implement trait" #132024
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
HiddenStruct
should not be volunteered to the user in an error message because that type isdoc(hidden)
.HiddenImpl
should not be volunteered as implementingTrait
because itsimpl Trait for HiddenImpl
isdoc(hidden)
.HiddenModule
is also not public, although indirectly.Context: this came up in serde-rs/serde#2558 (comment).
Rust Version
Anything else?
There is longstanding precedent for
#[doc(hidden)]
affecting what suggestions rustc tries to make.For example when suggesting imports. See #119151 and https://github.com/rust-lang/rust/blob/814df6e50eaf89b90793e7d9618bb60f1f18377a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs.
Also when suggesting struct fields. See #93214 and https://github.com/rust-lang/rust/blob/814df6e50eaf89b90793e7d9618bb60f1f18377a/tests/ui/did_you_mean/dont-suggest-doc-hidden-fields.rs.
The text was updated successfully, but these errors were encountered: