rustdoc: Render for<'_> lifetimes in front of where bound
This commit is contained in:
parent
312b894cc1
commit
e0162a8a56
8 changed files with 104 additions and 22 deletions
41
src/test/rustdoc/higher-ranked-trait-bounds.rs
Normal file
41
src/test/rustdoc/higher-ranked-trait-bounds.rs
Normal 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>,
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue