@@ -49,6 +49,8 @@ impl Foo {
4949 pub async fn mut_self ( mut self , mut first : usize ) { }
5050}
5151
52+ pub trait Pattern < ' a > { }
53+
5254pub trait Trait < const N : usize > { }
5355// @has async_fn/fn.const_generics.html
5456// @has - '//pre[@class="rust fn"]' 'pub async fn const_generics<const N: usize>(_: impl Trait<N>)'
@@ -70,6 +72,9 @@ pub async fn static_trait(foo: &str) -> Box<dyn Bar> {}
7072// @has async_fn/fn.lifetime_for_trait.html
7173// @has - '//pre[@class="rust fn"]' "pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_>"
7274pub async fn lifetime_for_trait ( foo : & str ) -> Box < dyn Bar + ' _ > { }
75+ // @has async_fn/fn.elided_in_input_trait.html
76+ // @has - '//pre[@class="rust fn"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)"
77+ pub async fn elided_in_input_trait ( t : impl Pattern < ' _ > ) { }
7378
7479struct AsyncFdReadyGuard < ' a , T > { x : & ' a T }
7580
@@ -80,4 +85,14 @@ impl Foo {
8085 // taken from `tokio` as an example of a method that was particularly bad before
8186 // @has - '//h4[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>"
8287 pub async fn readable < T > ( & self ) -> Result < AsyncFdReadyGuard < ' _ , T > , ( ) > { }
88+ // @has - '//h4[@class="method"]' "pub async fn mut_self(&mut self)"
89+ pub async fn mut_self ( & mut self ) { }
8390}
91+
92+ // test named lifetimes, just in case
93+ // @has async_fn/fn.named.html
94+ // @has - '//pre[@class="rust fn"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str"
95+ pub async fn named < ' a , ' b > ( foo : & ' a str ) -> & ' b str { }
96+ // @has async_fn/fn.named_trait.html
97+ // @has - '//pre[@class="rust fn"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>"
98+ pub async fn named_trait < ' a , ' b > ( foo : impl Pattern < ' a > ) -> impl Pattern < ' b > { }
0 commit comments