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 traits missing implementors when documented via --document-hidden-items #90781

Closed
steffahn opened this issue Nov 10, 2021 · 6 comments · Fixed by #132744
Closed

Hidden traits missing implementors when documented via --document-hidden-items #90781

steffahn opened this issue Nov 10, 2021 · 6 comments · Fixed by #132744
Assignees
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@steffahn
Copy link
Member

You can see --document-private-items --document-hidden-items docs of the standard library here:

https://stdrs.dev/nightly/x86_64-unknown-linux-gnu/std/iter/trait.InPlaceIterable.html

as you can see, the implementors are missing though (which is incredibly annoying if you ever want to work on those traits). Also reproducible locally by building RUSTDOCFLAGS='--document-private-items --document-hidden-items -A rustdoc::broken-intra-doc-links' ./x.py doc library/std --open

@rustbot label T-rustdoc

@steffahn steffahn added the C-bug Category: This is a bug. label Nov 10, 2021
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 10, 2021
@jyn514
Copy link
Member

jyn514 commented Nov 10, 2021

@steffahn can you reproduce this on anything smaller than the standard library?

@steffahn
Copy link
Member Author

steffahn commented Nov 10, 2021

I haven't tried it on anything else yet. I can do that tomorrow, when I'm back at a computer.

I also haven't checked whether this is a regression.

@jyn514 jyn514 added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Nov 10, 2021
@hellow554
Copy link
Contributor

hellow554 commented Nov 11, 2021

I did the full circle and wrote this:

pub trait T {}

pub struct VisPub;
struct VisPriv;
#[doc(hidden)]
pub struct HidPub;
#[doc(hidden)]
struct HidPriv;

impl T for VisPub {}
impl T for VisPriv {}
impl T for HidPub {}
impl T for HidPriv {}

Output is this:

grafik

so hidden items won't get displayed as Implementors, although displayed as structs on the "homepage":

grafik

@rustbot modify labels: -E-needs-mcve

@rustbot rustbot removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Nov 11, 2021
@steffahn
Copy link
Member Author

@hellow554 it's actually the trait that's hidden in the standard library, not the structs. Though your case not displaying the implementation is problematic, too.

@hellow554
Copy link
Contributor

hellow554 commented Nov 11, 2021

I see :) thanks for pointing it out:

Rust code
pub trait TPubVis {}
#[doc(hidden)]
pub trait TPubHidden {}
trait TPrivVis {}
#[doc(hidden)]
trait TPrivHidden {}

pub struct VisPub;
struct VisPriv;
#[doc(hidden)]
pub struct HidPub;
#[doc(hidden)]
struct HidPriv;

macro_rules! implement {
    ($trait:ident - $($struct:ident)+) => {
        $(
            impl $trait for $struct {}
        )+
    }
}


implement!(TPubVis - VisPub VisPriv HidPub HidPriv);
implement!(TPubHidden - VisPub VisPriv HidPub HidPriv);
implement!(TPrivVis - VisPub VisPriv HidPub HidPriv);
implement!(TPrivHidden - VisPub VisPriv HidPub HidPriv);

No implementors for a #[doc(hidden)] trait:
grafik

Only implementors that are not #[doc(hidden)]:
grafik

@lolbinarycat lolbinarycat self-assigned this Nov 7, 2024
@lolbinarycat lolbinarycat added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 7, 2024
@lolbinarycat
Copy link
Contributor

triage: this issue has been fixed, adding a regression test for it

lolbinarycat added a commit to lolbinarycat/rust that referenced this issue Nov 7, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 9, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#132341 (Reject raw lifetime followed by `'`, like regular lifetimes do)
 - rust-lang#132363 (Enforce that raw lifetimes must be valid raw identifiers)
 - rust-lang#132744 (add regression test for rust-lang#90781)
 - rust-lang#132754 (Simplify the internal API for declaring command-line options)
 - rust-lang#132772 (use `download-rustc="if-unchanged"` as a global default)
 - rust-lang#132774 (Use lld with non-LLVM backends)
 - rust-lang#132799 (Make `Ty::primitive_symbol` recognize `str`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in 5f58dc9 Nov 9, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 9, 2024
Rollup merge of rust-lang#132744 - lolbinarycat:test-90781, r=aDotInTheVoid

add regression test for rust-lang#90781

closes rust-lang#90781
mati865 pushed a commit to mati865/rust that referenced this issue Nov 12, 2024
mati865 pushed a commit to mati865/rust that referenced this issue Nov 12, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#132341 (Reject raw lifetime followed by `'`, like regular lifetimes do)
 - rust-lang#132363 (Enforce that raw lifetimes must be valid raw identifiers)
 - rust-lang#132744 (add regression test for rust-lang#90781)
 - rust-lang#132754 (Simplify the internal API for declaring command-line options)
 - rust-lang#132772 (use `download-rustc="if-unchanged"` as a global default)
 - rust-lang#132774 (Use lld with non-LLVM backends)
 - rust-lang#132799 (Make `Ty::primitive_symbol` recognize `str`)

r? `@ghost`
`@rustbot` modify labels: rollup
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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. 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.

5 participants