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 properly render higher-ranked lifetimes on the left-hand side of where clause bounds #39213

Closed
abonander opened this issue Jan 21, 2017 · 2 comments
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

@abonander
Copy link
Contributor

abonander commented Jan 21, 2017

Rustdoc confusingly renders the following function:

pub fn takes_ref<T>(foo: &T) where for<'a> &'a T: Sized {}

(Sized bound just used for demonstration, I know this doesn't add any meaning.)

as this:

pub fn takes_ref<T>(foo: &T) 
where &'a T: Sized

The for<'a> is omitted when it shouldn't be, because there's now magically a lifetime parameter that doesn't appear to be declared anywhere.

This doesn't just affect functions, of course:

pub struct Foo<T>(T) where for<'a> &'a T: Sized;
// Rendered:
pub struct Foo<T>(_) where &'a T: Sized;
pub trait Foo<T> where for<'a> &'a T: Sized {}
// Rendered: 
pub trait Foo<T> where &'a T: Sized { }

Higher-ranked lifetimes on the right-hand side of a where clause bound are rendered correctly:

pub trait Foo<T> where T: for<'a> Bar<'a> {}
pub trait Bar<'a> {}

// `Foo` rendered:
pub trait Foo<T> where T: for<'a> Bar<'a> { }
@sfackler sfackler added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 21, 2017
@durka
Copy link
Contributor

durka commented Feb 21, 2017

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 26, 2017
@jyn514
Copy link
Member

jyn514 commented Jul 7, 2021

Triage: duplicate of #78482 (or the other way around), fixed on nightly by #84814.

image

@jyn514 jyn514 closed this as completed Jul 7, 2021
@jyn514 jyn514 removed the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Jul 7, 2021
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
Development

No branches or pull requests

6 participants