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 HRTBs #78482

Closed
WaffleLapkin opened this issue Oct 28, 2020 · 8 comments · Fixed by #84814
Closed

rustdoc doesn't render HRTBs #78482

WaffleLapkin opened this issue Oct 28, 2020 · 8 comments · Fixed by #84814
Assignees
Labels
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

@WaffleLapkin
Copy link
Member

WaffleLapkin commented Oct 28, 2020

I tried this code:

pub fn test<T>() 
where
    for<'a> &'a T: Iterator,
{}

I expected rustdoc to render HRTB (for<'a>), but it doesn't:

image

Originally find while viewing keyberon docs.

Meta

rustdoc --version --verbose:

rustdoc 1.49.0-nightly (ffa2e7ae8 2020-10-24)
binary: rustdoc
commit-hash: ffa2e7ae8fbf9badc035740db949b9dae271c29f
commit-date: 2020-10-24
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0
@WaffleLapkin WaffleLapkin added the C-bug Category: This is a bug. label Oct 28, 2020
@jonas-schievink jonas-schievink added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 28, 2020
@jyn514 jyn514 added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Oct 28, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 28, 2020

Hmm, rustdoc should already handle this in

if !self.generic_params.is_empty() {
, which includes generic lifetimes: PolyTrait, GenericParamDef. Someone would need to investigate why that isn't showing up - I suspect somewhere in clean isn't handling it properly:
impl Clean<GenericBound> for hir::GenericBound<'_> {

@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. and removed E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Oct 28, 2020
@Rustin170506
Copy link
Member

@jyn514 Can I working on this? I want to have a try.

@jyn514
Copy link
Member

jyn514 commented Oct 29, 2020

@hi-rustin absolutely! If you have trouble, feel free to ask for help in the rustdoc channel or on Zulip :)

@Rustin170506
Copy link
Member

@rustbot claim

@Rustin170506
Copy link
Member

I started to try it.

@Rustin170506
Copy link
Member

Rustin170506 commented Apr 5, 2021

Hmm, rustdoc should already handle this in

if !self.generic_params.is_empty() {

, which includes generic lifetimes: PolyTrait, GenericParamDef. Someone would need to investigate why that isn't showing up - I suspect somewhere in clean isn't handling it properly:

impl Clean<GenericBound> for hir::GenericBound<'_> {

@jyn514 Do you mean that we are missing generic_params? I tried constructing generic_params, but it still doesn't seem to work.

@jyn514
Copy link
Member

jyn514 commented Apr 5, 2021

@hi-rustin I don't know, that's what I mean by investigate. You could start by checking if generic_params is empty or not, or whether this code path is being taken at all.

@Rustin170506 Rustin170506 removed their assignment Apr 28, 2021
@Stupremee
Copy link
Member

Stupremee commented May 1, 2021

@rustbot claim

I already found the problem and just need to fix it now!

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-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.

6 participants