diff options
| author | Justus K <justus.k@protonmail.com> | 2021-05-02 14:48:28 +0200 |
|---|---|---|
| committer | Justus K <justus.k@protonmail.com> | 2021-06-18 21:57:55 +0200 |
| commit | e0162a8a56d1c59e185e293f33c38d94a5a2d462 (patch) | |
| tree | 068b7709ff8b46d74e5872d460038a34699c8f57 /src/test | |
| parent | 312b894cc12240a3fcc645474c3daa14f7d568ea (diff) | |
| download | rust-e0162a8a56d1c59e185e293f33c38d94a5a2d462.tar.gz rust-e0162a8a56d1c59e185e293f33c38d94a5a2d462.zip | |
rustdoc: Render `for<'_>` lifetimes in front of where bound
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/rustdoc/higher-ranked-trait-bounds.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/test/rustdoc/higher-ranked-trait-bounds.rs b/src/test/rustdoc/higher-ranked-trait-bounds.rs new file mode 100644 index 00000000000..b5c55df287b --- /dev/null +++ b/src/test/rustdoc/higher-ranked-trait-bounds.rs @@ -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>, + { + } +} |
