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.
Rollup merge of rust-lang#101204 - aDotInTheVoid:async-resugar-in-cle…
…an, r=GuillaumeGomez rustdoc: Resugar async fn return type in `clean`, not `html` This way it also happens for json output. Fixes rust-lang#101199 r? ``@GuillaumeGomez``
- Loading branch information
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 } | ||
} |