2018-08-09 11:46:39 -05:00
|
|
|
// edition:2018
|
|
|
|
|
2019-02-05 10:12:43 -05:00
|
|
|
// @has async_fn/fn.foo.html '//pre[@class="rust fn"]' 'pub async fn foo() -> Option<Foo>'
|
|
|
|
pub async fn foo() -> Option<Foo> {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
|
|
|
// @has async_fn/fn.bar.html '//pre[@class="rust fn"]' 'pub async fn bar(a: i32, b: i32) -> i32'
|
|
|
|
pub async fn bar(a: i32, b: i32) -> i32 {
|
|
|
|
0
|
|
|
|
}
|
|
|
|
|
|
|
|
// @has async_fn/fn.baz.html '//pre[@class="rust fn"]' 'pub async fn baz<T>(a: T) -> T'
|
|
|
|
pub async fn baz<T>(a: T) -> T {
|
|
|
|
a
|
|
|
|
}
|
|
|
|
|
2020-01-20 18:14:51 +00:00
|
|
|
// @has async_fn/fn.qux.html '//pre[@class="rust fn"]' 'pub async unsafe fn qux() -> char'
|
|
|
|
pub async unsafe fn qux() -> char {
|
|
|
|
'⚠'
|
|
|
|
}
|
|
|
|
|
2019-02-05 10:12:43 -05:00
|
|
|
trait Bar {}
|
|
|
|
|
|
|
|
impl Bar for () {}
|
|
|
|
|
|
|
|
// @has async_fn/fn.quux.html '//pre[@class="rust fn"]' 'pub async fn quux() -> impl Bar'
|
|
|
|
pub async fn quux() -> impl Bar {
|
|
|
|
()
|
|
|
|
}
|
|
|
|
|
|
|
|
// @has async_fn/struct.Foo.html
|
|
|
|
// @matches - '//code' 'pub async fn f\(\)$'
|
2020-01-20 18:14:51 +00:00
|
|
|
// @matches - '//code' 'pub async unsafe fn g\(\)$'
|
2019-02-05 10:12:43 -05:00
|
|
|
pub struct Foo;
|
2018-08-09 11:46:39 -05:00
|
|
|
|
2019-02-05 10:12:43 -05:00
|
|
|
impl Foo {
|
2018-08-09 11:46:39 -05:00
|
|
|
pub async fn f() {}
|
2020-01-20 18:14:51 +00:00
|
|
|
pub async unsafe fn g() {}
|
2018-08-09 11:46:39 -05:00
|
|
|
}
|