cross-crate #[doc(hidden)]
is ignored when listing trait implementations #86448
Closed
Description
Context
https://users.rust-lang.org/t/hidden-trait-implementation-in-online-docs/61256/4
Repro
set -euo pipefail
cd $(mktemp -d)
cargo new -q --lib dependency
cat> dependency/src/lib.rs <<'EOF'
#[doc(hidden)]
pub enum HiddenType {}
pub enum MyLibType {}
impl From<HiddenType> for MyLibType {
fn from (it: HiddenType)
-> MyLibType
{
match it {}
}
}
EOF
(cd dependency
set -x
cargo doc -q --no-deps
# No matches
! grep -o HiddenType target/doc/dependency/index.html
)
cargo init -q --lib --name mylib
cat> src/lib.rs <<'EOF'
pub use ::dependency::HiddenType; // OK, not re-exported
pub enum MyLibType {}
impl From<HiddenType> for MyLibType {
fn from (it: HiddenType)
-> MyLibType
{
match it {}
}
}
EOF
cat>> Cargo.toml <<'EOF'
dependency.path = 'dependency'
EOF
set -x
cargo doc -q --no-deps
# No matches
! grep -o HiddenType target/doc/mylib/index.html
# There are matches
grep -o HiddenType target/doc/mylib/enum.MyLibType.html
-
Last line yields several occurrences of
HiddenType
in the generated.html
file.Expected behavior
No occurrences of
HiddenType
anywhere since it was#[doc(hidden)]
@rustbot label C-bug T-rustdoc
Metadata
Assignees
Labels
Area: Documentation that has been re-exported from a different crateCategory: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the rustdoc team, which will review and decide on the PR/issue.