-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Don't display mut
in arguments for functions documentation
#81831
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you re-add the tests that you removed?
Right now it will make rustdoc panic: https://github.com/rust-lang/rust/blob/95acccc32a090937bde0fbe087358721df888629/src/librustdoc/clean/utils.rs#L412-L415 Do you want me to fix this? |
Yes please, take a look at #80220 for suggestions on how. |
This reverts commit 31375d2.
PatKind::Lit(..) => { | ||
warn!( | ||
"tried to get argument name from PatKind::Lit, which is silly in function arguments" | ||
); | ||
return Symbol::intern("()"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, shouldn't this just panic? The case for ()
is handled through PatKind::Tuple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this warn!
macro even coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 24 to 25 in 0fc6756
#[macro_use] | |
extern crate tracing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably should panic, but let's do that in a different PR so we can fix the regression.
95acccc
to
f8ce972
Compare
I took the easy route and replaced the range pattern with |
This comment has been minimized.
This comment has been minimized.
f8ce972
to
0a4c0e3
Compare
CI is passing now |
PatKind::Lit(..) => { | ||
warn!( | ||
"tried to get argument name from PatKind::Lit, which is silly in function arguments" | ||
); | ||
return Symbol::intern("()"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably should panic, but let's do that in a different PR so we can fix the regression.
0a4c0e3
to
1429d80
Compare
This comment has been minimized.
This comment has been minimized.
1429d80
to
089ee27
Compare
Will hopefully get to this tomorrow. |
Beta-nominating since this bug is now on beta. |
Actually I have time now! @bors r+ |
📌 Commit 089ee27 has been approved by |
Backporting sounds good to me - @rust-lang/rustdoc what do you think? |
Note that beta only branched a few days ago, so it's just because it landed a few days late. |
Backport sgtm |
…melid Don't display `mut` in arguments for functions documentation Fixes rust-lang#81289 by reverting rust-lang#80799, as requested in rust-lang#81328 (comment). Supersedes rust-lang#81328. r? `@camelid` cc `@jyn514`
Sounds good to m as well. |
Rollup of 16 pull requests Successful merges: - rust-lang#79983 (fix indefinite article in cell.rs) - rust-lang#81831 (Don't display `mut` in arguments for functions documentation) - rust-lang#81947 (Relax ItemCtxt::to_ty lifetime) - rust-lang#81954 (RELEASES.md 1.50: Group platform support notes together) - rust-lang#81955 (bootstrap: Locate llvm-dwp based on llvm-config bindir) - rust-lang#81959 (Fix assosiated typo) - rust-lang#81964 (Fix documentation not showing on localStorage error) - rust-lang#81968 (bootstrap: fix wrong docs installation path) - rust-lang#81990 (Make suggestion of changing mutability of arguments broader) - rust-lang#81994 (Improve long explanation for E0542 and E0546) - rust-lang#81997 (dist: include src/build_helper as part of the crate graph for rustc-dev) - rust-lang#82003 (Stack probes: fix error message) - rust-lang#82004 (clean up clean::Static struct) - rust-lang#82011 (Fix private intra-doc warnings on associated items) - rust-lang#82013 (Tell user how to fix CI file being not up to date) - rust-lang#82017 (Fix typo in mod.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Awesome, that's more than half the team so I'm going to go ahead and mark this as accepted. |
…ulacrum [beta] backports This backports some PRs and bumps to the released stable compiler: * bootstrap: fix wrong docs installation path rust-lang#81968 * parser: Fix panic in 'const impl' recovery rust-lang#81876 * Don't display `mut` in arguments for functions documentation rust-lang#81831 r? `@Mark-Simulacrum`
Fixes #81289 by reverting #80799, as requested in #81328 (comment).
Supersedes #81328.
r? @camelid cc @jyn514