-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc renames parameters with mut
in async fn
#76517
Comments
mut
in async fn
Relevant code: rust/src/librustdoc/html/format.rs Line 992 in c9a48d1
Not sure what's going wrong. |
Thanks for the helpful hint, @jyn514! However, I'm not convinced this is the root cause because it's happening to all mutable by-value function arguments, not just to pub async fn foo(mut first: usize, mut second: usize) {} I think the actual root cause may be deeper than the interpretation of |
This example confirms that the behavior appears to be per-argument instead of per-function. It's not like one bad argument ruins the formatting of the entire function. pub async fn foo(good: usize, mut bad: usize) {} Perhaps we could investigate where in the code the |
Hmm, the only relevant location I could find through GitHub search is in rust/compiler/rustc_ast_lowering/src/item.rs Line 1104 in 94b4de0
Is |
Here's the issue: rust/compiler/rustc_ast_lowering/src/item.rs Lines 1096 to 1109 in c101116
Looks like it should use |
Yes, rustdoc works on a desugared version and has to reconstruct the |
Sure, @jyn514! I will prepare one right away. Thanks for investigating with me. 😄 |
…nc-fn, r=tmandry Fix rustdoc rendering of by-value mutable arguments in async fn r? `@jyn514` Fixes rust-lang#76517.
Original:
Rendered:
This example was tested on Rust 1.46.0, but it has been broken for quite a while. For example, see
Server::serve()
intower-lsp
version 0.7.0 (built with Rust 1.43.0-nightly, see docs.rs build info).The text was updated successfully, but these errors were encountered: