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

Hidden methods still appear in trait implementation docs #13698

Closed
chris-morgan opened this issue Apr 23, 2014 · 12 comments · Fixed by #13704
Closed

Hidden methods still appear in trait implementation docs #13698

chris-morgan opened this issue Apr 23, 2014 · 12 comments · Fixed by #13704
Assignees
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@chris-morgan
Copy link
Member

Take, for example, TotalEq:

pub trait TotalEq: Eq {
    // FIXME #13101: this method is used solely by #[deriving] to
    // assert that every component of a type implements #[deriving]
    // itself, the current deriving infrastructure means doing this
    // assertion without using a method on this trait is nearly
    // impossible.
    //
    // This should never be implemented by hand.
    #[doc(hidden)]
    #[inline(always)]
    fn assert_receiver_is_total_eq(&self) {}
}

As is proper, the TotalEq docs make no mention of this hidden method assert_receiver_is_total_eq.

But now refer to an example like the TotalEq impl for Option! Lo! assert_receiver_is_total_eq is shown there.

It shouldn't be.

@mahkoh
Copy link
Contributor

mahkoh commented Mar 5, 2015

This is broken again.

@bstrie bstrie reopened this Apr 4, 2015
@mitsuhiko
Copy link
Contributor

Still happens, example down here: http://mitsuhiko.github.io/redis-rs/redis/enum.ErrorKind.html

@SimonSapin
Copy link
Contributor

It looks like this is happening again in #51147 (comment).

@kzys
Copy link
Contributor

kzys commented Sep 18, 2018

@SimonSapin Do you remember what was the issue on #51147? Seems SliceIndex's Rustdoc no longer shows any hidden methods/traits.

https://doc.rust-lang.org/nightly/std/slice/trait.SliceIndex.html

@SimonSapin
Copy link
Contributor

In #51147 we wanted to hide SliceIndex’s methods, but couldn’t because the impl docs had broken links (and the linkchecker wouldn’t let us land that PR).

@kzys
Copy link
Contributor

kzys commented Sep 18, 2018

I see. Hiding get(), get_mut(), get_unchecked(), ... and all of them?

@SimonSapin
Copy link
Contributor

Yes, these methods are permanently-unstable implementation details of methods like [T]::get. The trait itself is only stable so that code that calls [T]::get can itself be generic in the same way. See discussion at #35729 (comment).

kzys added a commit to kzys/rust that referenced this issue Sep 19, 2018
Rustdoc should be able to handle that. Fixes rust-lang#13698.
@kzys
Copy link
Contributor

kzys commented Sep 26, 2018

@GuillaumeGomez GuillaumeGomez self-assigned this Nov 14, 2019
@jrvidal
Copy link
Contributor

jrvidal commented Nov 17, 2019

@GuillaumeGomez I was looking into this as a way of better understanding rustdoc internals. Do you plan to tackle it?

@GuillaumeGomez
Copy link
Member

Go ahead! I have a lot of other things to do. :)

@jrvidal
Copy link
Contributor

jrvidal commented Dec 3, 2019

@GuillaumeGomez suggests that making #[doc(hidden)] automatically hide the corresponding items in trait implementations is undesirable, since it is not reversible and the implementer could easily hide the items manually.

If that's the case, should this issue be closed?

@GuillaumeGomez
Copy link
Member

From my point of view, it should. Let's close it now and if someone wants to debate, I'll let the comments open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet