Rustdoc renders async fn incorrectly #58027
Labels
A-async-await
Area: Async & Await
C-bug
Category: This is a bug.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Summary
While experimenting with
async fn
andawait!()
on nightly Rust, I noticed thatcargo doc
renders them incorrectly. It displays the following:I expected the output to be something like this:
I believe having
async fn
displayed as returning animpl Future
like that is misleading because theasync
keyword 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 fn
is: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 fn
code in it, and then runningcargo doc --open
.The text was updated successfully, but these errors were encountered: