-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #116084 - fmease:rustdoc-fix-x-crate-async-fn, r=Guilla…
…umeGomez rustdoc: correctly render the return type of cross-crate async fns Fixes #115760.
- Loading branch information
Showing
6 changed files
with
72 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters