Skip to content
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 does not hide implementations of doc(hidden) trait methods #89186

Closed
jyn514 opened this issue Sep 22, 2021 · 2 comments · Fixed by #89198
Closed

Rustdoc does not hide implementations of doc(hidden) trait methods #89186

jyn514 opened this issue Sep 22, 2021 · 2 comments · Fixed by #89198
Assignees
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Sep 22, 2021

I tried this code:

pub trait Trait {
    #[doc(hidden)]
    fn f();
}
pub struct S;
impl Trait for S {
    fn f() {}
}

I expected to see this happen: Rustdoc does not show f in the documentation for S.

Instead, this happened:
image

Since f is properly hidden in the documentation for Trait, the link for f is broken.

Meta

rustc --version --verbose:

rustc 1.57.0-nightly (ac2d9fc50 2021-09-21)

Originally posted by @rust-log-analyzer in #89167 (comment)

@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-trait-system Area: Trait system C-bug Category: This is a bug. labels Sep 22, 2021
@jyn514
Copy link
Member Author

jyn514 commented Sep 22, 2021

Mentoring instructions: when generating trait impls and --document-hidden-items is not passed, skip all methods where the method in the original trait was hidden. See #86513 for a similar change - the relevant code is build_impl in src/librustdoc/clean/inline.rs.

@jyn514 jyn514 added E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Sep 22, 2021
@hkmatsumoto
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system C-bug Category: This is a bug. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants