diff options
Diffstat (limited to '')
-rw-r--r-- | tests/rustdoc/inline_cross/async-fn.rs | 19 | ||||
-rw-r--r-- | tests/rustdoc/inline_cross/auxiliary/async-fn.rs | 18 | ||||
-rw-r--r-- | tests/rustdoc/inline_cross/auxiliary/const-fn.rs | 5 | ||||
-rw-r--r-- | tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs | 6 | ||||
-rw-r--r-- | tests/rustdoc/inline_cross/const-fn.rs | 10 | ||||
-rw-r--r-- | tests/rustdoc/inline_cross/impl_trait.rs | 8 |
6 files changed, 52 insertions, 14 deletions
diff --git a/tests/rustdoc/inline_cross/async-fn.rs b/tests/rustdoc/inline_cross/async-fn.rs new file mode 100644 index 000000000..95e175aab --- /dev/null +++ b/tests/rustdoc/inline_cross/async-fn.rs @@ -0,0 +1,19 @@ +// Regression test for issue #115760. +// Check that we render the correct return type of free and +// associated async functions reexported from external crates. + +// aux-crate:async_fn=async-fn.rs +// edition: 2021 +#![crate_name = "user"] + +// @has user/fn.load.html +// @has - '//pre[@class="rust item-decl"]' "pub async fn load() -> i32" +pub use async_fn::load; + +// @has user/trait.Load.html +// @has - '//*[@id="tymethod.run"]' 'async fn run(&self) -> i32' +pub use async_fn::Load; + +// @has user/struct.Loader.html +// @has - '//*[@id="method.run"]' 'async fn run(&self) -> i32' +pub use async_fn::Loader; diff --git a/tests/rustdoc/inline_cross/auxiliary/async-fn.rs b/tests/rustdoc/inline_cross/auxiliary/async-fn.rs new file mode 100644 index 000000000..767564ed1 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/async-fn.rs @@ -0,0 +1,18 @@ +#![feature(async_fn_in_trait)] +// edition: 2021 + +pub async fn load() -> i32 { + 0 +} + +pub trait Load { + async fn run(&self) -> i32; +} + +pub struct Loader; + +impl Load for Loader { + async fn run(&self) -> i32 { + 1 + } +} diff --git a/tests/rustdoc/inline_cross/auxiliary/const-fn.rs b/tests/rustdoc/inline_cross/auxiliary/const-fn.rs new file mode 100644 index 000000000..26332b419 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/const-fn.rs @@ -0,0 +1,5 @@ +#![feature(effects)] + +pub const fn load() -> i32 { + 0 +} diff --git a/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs b/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs index 19433c968..42cfc3dc3 100644 --- a/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs +++ b/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs @@ -33,9 +33,3 @@ pub struct Foo; impl Foo { pub fn method<'a>(_x: impl Clone + Into<Vec<u8>> + 'a) {} } - -pub struct Bar; - -impl Bar { - pub async fn async_foo(&self) {} -} diff --git a/tests/rustdoc/inline_cross/const-fn.rs b/tests/rustdoc/inline_cross/const-fn.rs new file mode 100644 index 000000000..24934b873 --- /dev/null +++ b/tests/rustdoc/inline_cross/const-fn.rs @@ -0,0 +1,10 @@ +// Regression test for issue #116629. +// Check that we render the correct generic params of const fn + +// aux-crate:const_fn=const-fn.rs +// edition: 2021 +#![crate_name = "user"] + +// @has user/fn.load.html +// @has - '//pre[@class="rust item-decl"]' "pub const fn load() -> i32" +pub use const_fn::load; diff --git a/tests/rustdoc/inline_cross/impl_trait.rs b/tests/rustdoc/inline_cross/impl_trait.rs index b6a1552bc..5c802c514 100644 --- a/tests/rustdoc/inline_cross/impl_trait.rs +++ b/tests/rustdoc/inline_cross/impl_trait.rs @@ -33,15 +33,7 @@ pub use impl_trait_aux::func4; // @!has - '//pre[@class="rust item-decl"]' 'where' pub use impl_trait_aux::func5; -// @has impl_trait/fn.async_fn.html -// @has - '//pre[@class="rust item-decl"]' "pub async fn async_fn()" -pub use impl_trait_aux::async_fn; - // @has impl_trait/struct.Foo.html // @has - '//*[@id="method.method"]//h4[@class="code-header"]' "pub fn method<'a>(_x: impl Clone + Into<Vec<u8, Global>> + 'a)" // @!has - '//*[@id="method.method"]//h4[@class="code-header"]' 'where' pub use impl_trait_aux::Foo; - -// @has impl_trait/struct.Bar.html -// @has - '//*[@id="method.async_foo"]' "pub async fn async_foo(" -pub use impl_trait_aux::Bar; |