Closed
Description
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> { }