-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Rustdoc renders async fn incorrectly #58027
Copy link
Copy link
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitC-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
While experimenting with
async fnandawait!()on nightly Rust, I noticed thatcargo docrenders them incorrectly. It displays the following:I expected the output to be something like this:
I believe having
async fndisplayed as returning animpl Futurelike that is misleading because theasynckeyword at the beginning makes it seem like the return value is a nested future, when it really isn't. That is, it erroneously suggests that the desugared form of theasync fnis:Toolchain information
rustc 1.33.0-nightly (b43986184 2019-01-11)rustdoc 1.33.0-nightly (b43986184 2019-01-11)x86_64-apple-darwin)How to reproduce
The minimal verifiable example for this issue is essentially creating a new Cargo project with some trivial
async fncode in it, and then runningcargo doc --open.