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 doesn't render generic params & where-clauses of cross-crate GATs in certain sections #112904

Closed
fmease opened this issue Jun 21, 2023 · 2 comments · Fixed by #112920
Closed
Assignees
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@fmease
Copy link
Member

fmease commented Jun 21, 2023

While rustdoc does indeed render generic parameters and where-clauses of cross-crate GATs in the .item-decl of traits or in the section Required Associated Types for example, it doesn't do so in section Implementors on trait pages or section Trait Implementations on an implementor's page. I haven't exhaustively checked yet where precisely they're dropped and where they aren't.

Reproducer:

// a.rs

pub struct S;

pub trait Tr {
    type F<T>
    where
        (T,): Clone;
}

impl Tr for S {
    type F<T> = T
    where
        (T,): Clone;
}
// b.rs

pub use a::*;
rustc a.rs --crate-type=lib --edition=2021
rustdoc b.rs --crate-type=lib --edition=2021 --extern=a=liba.rlib

Screenshot 2023-06-21 at 20-44-55 Tr in unx - Rust

@rustbot claim
@rustbot label C-bug T-rustdoc A-cross-crate-reexports

@rustbot rustbot added A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 21, 2023
@compiler-errors
Copy link
Member

strange that this wasn't fixed by #103190

@fmease
Copy link
Member Author

fmease commented Jun 21, 2023

that also came to my mind when I noticed this, looking into it

TaKO8Ki added a commit to TaKO8Ki/rust that referenced this issue Jun 26, 2023
…aumeGomez

rustdoc: render generic params & where-clauses of cross-crate assoc tys in impls

We used to only ever render generic parameters & where-clauses of cross-crate associated types when the item was located inside of a trait and we used to just drop them when it was inside of an impl block (trait or inherent).

Fixes rust-lang#112904.

`@rustbot` label A-cross-crate-reexports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross-crate-reexports Area: Documentation that has been re-exported from a different crate 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
Development

Successfully merging a pull request may close this issue.

3 participants