@@ -48,6 +48,8 @@ impl Foo {
4848
4949pub trait Pattern < ' a > { }
5050
51+ impl Pattern < ' _ > for ( ) { }
52+
5153pub trait Trait < const N : usize > { }
5254// @has async_fn/fn.const_generics.html
5355// @has - '//pre[@class="rust item-decl"]' 'pub async fn const_generics<const N: usize>(_: impl Trait<N>)'
@@ -57,18 +59,18 @@ pub async fn const_generics<const N: usize>(_: impl Trait<N>) {}
5759// regression test for #63037
5860// @has async_fn/fn.elided.html
5961// @has - '//pre[@class="rust item-decl"]' 'pub async fn elided(foo: &str) -> &str'
60- pub async fn elided ( foo : & str ) -> & str { }
62+ pub async fn elided ( foo : & str ) -> & str { "" }
6163// This should really be shown as written, but for implementation reasons it's difficult.
6264// See `impl Clean for TyKind::Ref`.
6365// @has async_fn/fn.user_elided.html
6466// @has - '//pre[@class="rust item-decl"]' 'pub async fn user_elided(foo: &str) -> &str'
65- pub async fn user_elided ( foo : & ' _ str ) -> & str { }
67+ pub async fn user_elided ( foo : & ' _ str ) -> & str { "" }
6668// @has async_fn/fn.static_trait.html
6769// @has - '//pre[@class="rust item-decl"]' 'pub async fn static_trait(foo: &str) -> Box<dyn Bar>'
68- pub async fn static_trait ( foo : & str ) -> Box < dyn Bar > { }
70+ pub async fn static_trait ( foo : & str ) -> Box < dyn Bar > { Box :: new ( ( ) ) }
6971// @has async_fn/fn.lifetime_for_trait.html
7072// @has - '//pre[@class="rust item-decl"]' "pub async fn lifetime_for_trait(foo: &str) -> Box<dyn Bar + '_>"
71- pub async fn lifetime_for_trait ( foo : & str ) -> Box < dyn Bar + ' _ > { }
73+ pub async fn lifetime_for_trait ( foo : & str ) -> Box < dyn Bar + ' _ > { Box :: new ( ( ) ) }
7274// @has async_fn/fn.elided_in_input_trait.html
7375// @has - '//pre[@class="rust item-decl"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)"
7476pub async fn elided_in_input_trait ( t : impl Pattern < ' _ > ) { }
@@ -78,18 +80,20 @@ struct AsyncFdReadyGuard<'a, T> { x: &'a T }
7880impl Foo {
7981 // @has async_fn/struct.Foo.html
8082 // @has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar ) -> impl Iterator<Item = &usize>'
81- pub async fn complicated_lifetimes ( & self , context : & impl Bar ) -> impl Iterator < Item = & usize > { }
83+ pub async fn complicated_lifetimes ( & self , context : & impl Bar ) -> impl Iterator < Item = & usize > {
84+ [ 0 ] . iter ( )
85+ }
8286 // taken from `tokio` as an example of a method that was particularly bad before
8387 // @has - '//*[@class="method"]' "pub async fn readable<T>(&self) -> Result<AsyncFdReadyGuard<'_, T>, ()>"
84- pub async fn readable < T > ( & self ) -> Result < AsyncFdReadyGuard < ' _ , T > , ( ) > { }
88+ pub async fn readable < T > ( & self ) -> Result < AsyncFdReadyGuard < ' _ , T > , ( ) > { Err ( ( ) ) }
8589 // @has - '//*[@class="method"]' "pub async fn mut_self(&mut self)"
8690 pub async fn mut_self ( & mut self ) { }
8791}
8892
8993// test named lifetimes, just in case
9094// @has async_fn/fn.named.html
9195// @has - '//pre[@class="rust item-decl"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str"
92- pub async fn named < ' a , ' b > ( foo : & ' a str ) -> & ' b str { }
96+ pub async fn named < ' a , ' b > ( foo : & ' a str ) -> & ' b str { "" }
9397// @has async_fn/fn.named_trait.html
9498// @has - '//pre[@class="rust item-decl"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>"
9599pub async fn named_trait < ' a , ' b > ( foo : impl Pattern < ' a > ) -> impl Pattern < ' b > { }
0 commit comments