rustdoc: Render for<'_> lifetimes in front of where bound

This commit is contained in:
Justus K 2021-05-02 14:48:28 +02:00
parent 312b894cc1
commit e0162a8a56
No known key found for this signature in database
GPG key ID: 8C62FE98A62FC462
8 changed files with 104 additions and 22 deletions

View file

@ -0,0 +1,41 @@
#![crate_name = "foo"]
trait A<'x> {}
// @has foo/fn.test1.html
// @has - '//pre' "pub fn test1<T>() where for<'a> &'a T: Iterator,"
pub fn test1<T>()
where
for<'a> &'a T: Iterator,
{
}
// @has foo/fn.test2.html
// @has - '//pre' "pub fn test2<T>() where for<'a, 'b> &'a T: A<'b>,"
pub fn test2<T>()
where
for<'a, 'b> &'a T: A<'b>,
{
}
// @has foo/fn.test3.html
// @has - '//pre' "pub fn test3<F>() where F: for<'a, 'b> Fn(&'a u8, &'b u8),"
pub fn test3<F>()
where
F: for<'a, 'b> Fn(&'a u8, &'b u8),
{
}
// @has foo/struct.Foo.html
pub struct Foo<'a> {
_x: &'a u8,
}
impl<'a> Foo<'a> {
// @has - '//code' "pub fn bar<T>() where T: A<'a>,"
pub fn bar<T>()
where
T: A<'a>,
{
}
}