Skip to content

Commit 726fe3b

Browse files
committed
add rustdoc test for async fn reexport
1 parent a813cc1 commit 726fe3b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/test/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// edition:2018
2+
13
use std::ops::Deref;
24

35
pub fn func<'a>(_x: impl Clone + Into<Vec<u8>> + 'a) {}
@@ -11,8 +13,16 @@ pub fn func3(_x: impl Iterator<Item = impl Iterator<Item = u8>> + Clone) {}
1113

1214
pub fn func4<T: Iterator<Item = impl Clone>>(_x: T) {}
1315

16+
pub async fn async_fn() {}
17+
1418
pub struct Foo;
1519

1620
impl Foo {
1721
pub fn method<'a>(_x: impl Clone + Into<Vec<u8>> + 'a) {}
1822
}
23+
24+
pub struct Bar;
25+
26+
impl Bar {
27+
pub async fn async_foo(&self) {}
28+
}

src/test/rustdoc/inline_cross/impl_trait.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// aux-build:impl_trait_aux.rs
2+
// edition:2018
23

34
extern crate impl_trait_aux;
45

@@ -20,13 +21,20 @@ pub use impl_trait_aux::func2;
2021
// @!has - '//pre[@class="rust fn"]' 'where'
2122
pub use impl_trait_aux::func3;
2223

23-
2424
// @has impl_trait/fn.func4.html
2525
// @has - '//pre[@class="rust fn"]' "func4<T>("
2626
// @has - '//pre[@class="rust fn"]' "T: Iterator<Item = impl Clone>,"
2727
pub use impl_trait_aux::func4;
2828

29+
// @has impl_trait/fn.async_fn.html
30+
// @has - '//pre[@class="rust fn"]' "pub async fn async_fn()"
31+
pub use impl_trait_aux::async_fn;
32+
2933
// @has impl_trait/struct.Foo.html
3034
// @has - '//code[@id="method.v"]' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8>> + 'a)"
3135
// @!has - '//code[@id="method.v"]' 'where'
3236
pub use impl_trait_aux::Foo;
37+
38+
// @has impl_trait/struct.Bar.html
39+
// @has - '//*[@id="method.async_foo"]' "pub async fn async_foo("
40+
pub use impl_trait_aux::Bar;

0 commit comments

Comments
 (0)