]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/macro-higher-kinded-function.rs
Rollup merge of #107773 - Mark-Simulacrum:rename-auto-template, r=estebank
[rust.git] / tests / rustdoc / macro-higher-kinded-function.rs
1 #![crate_name = "foo"]
2
3 pub struct TyCtxt<'tcx>(&'tcx u8);
4
5 macro_rules! gen {
6     ($(($name:ident, $tcx:lifetime, [$k:ty], [$r:ty]))*) => {
7         pub struct Providers {
8             $(pub $name: for<$tcx> fn(TyCtxt<$tcx>, $k) -> $r,)*
9         }
10     }
11 }
12
13 // @has 'foo/struct.Providers.html'
14 // @has - '//*[@class="rust item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
15 // @has - '//*[@class="rust item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
16 // @has - '//*[@id="structfield.a"]/code' "a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8"
17 // @has - '//*[@id="structfield.b"]/code' "b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16"
18 gen! {
19     (a, 'tcx, [u8], [i8])
20     (b, 'tcx, [u16], [i16])
21 }