forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc: Resugar async fn return type in
clean
, not html
This way it also happens for json output. Fixes rust-lang#101199
- Loading branch information
1 parent
0631ea5
commit 6099d17
Showing
5 changed files
with
46 additions
and
16 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
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,36 @@ | ||
// edition:2021 | ||
// ignore-tidy-linelength | ||
|
||
// Regression test for <https://github.com/rust-lang/rust/issues/101199> | ||
|
||
use std::future::Future; | ||
|
||
// @is "$.index[*][?(@.name=='get_int')].inner.decl.output" '{"inner": "i32", "kind": "primitive"}' | ||
// @is "$.index[*][?(@.name=='get_int')].inner.header.async" false | ||
pub fn get_int() -> i32 { | ||
42 | ||
} | ||
|
||
// @is "$.index[*][?(@.name=='get_int_async')].inner.decl.output" '{"inner": "i32", "kind": "primitive"}' | ||
// @is "$.index[*][?(@.name=='get_int_async')].inner.header.async" true | ||
pub async fn get_int_async() -> i32 { | ||
42 | ||
} | ||
|
||
// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.kind" '"impl_trait"' | ||
// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.inner[0].trait_bound.trait.name" '"Future"' | ||
// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].name" '"Output"' | ||
// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].binding.equality.type" '{"inner": "i32", "kind": "primitive"}' | ||
// @is "$.index[*][?(@.name=='get_int_future')].inner.header.async" false | ||
pub fn get_int_future() -> impl Future<Output = i32> { | ||
async { 42 } | ||
} | ||
|
||
// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.kind" '"impl_trait"' | ||
// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.inner[0].trait_bound.trait.name" '"Future"' | ||
// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].name" '"Output"' | ||
// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].binding.equality.type" '{"inner": "i32", "kind": "primitive"}' | ||
// @is "$.index[*][?(@.name=='get_int_future_async')].inner.header.async" true | ||
pub async fn get_int_future_async() -> impl Future<Output = i32> { | ||
async { 42 } | ||
} |