Skip to content
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 documents mut self as mut self: Self #81289

Closed
tesuji opened this issue Jan 23, 2021 · 8 comments · Fixed by #81831
Closed

rustdoc documents mut self as mut self: Self #81289

tesuji opened this issue Jan 23, 2021 · 8 comments · Fixed by #81831
Assignees
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Milestone

Comments

@tesuji
Copy link
Contributor

tesuji commented Jan 23, 2021

Rustdoc on nightly documents methods have signature of fn(mut self) as fn(mut self: Self) while it only has to document it as fn(self).
image

On rustdoc stable, things are normal:
image

Meta

rustc --version --verbose: Version 1.49.0 (e1884a8 2020-12-29)

@tesuji tesuji added the C-bug Category: This is a bug. label Jan 23, 2021
@rustbot rustbot added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 23, 2021
@LeSeulArtichaut LeSeulArtichaut self-assigned this Jan 23, 2021
@LeSeulArtichaut
Copy link
Contributor

I'd like to investigate this :)

@LeSeulArtichaut
Copy link
Contributor

searched nightlies: from nightly-2020-12-29 to nightly-2021-01-22
regressed nightly: nightly-2021-01-09
searched commits: from c8915ee to 26438b4
regressed commit: 9155a9d

This regressed in #80806, so this is probably caused by #80799

@LeSeulArtichaut
Copy link
Contributor

This also affects

fn bar(mut foo) {}

Where rustdoc will generate:

fn bar(mut foo: Foo)

@LeSeulArtichaut
Copy link
Contributor

So a few observations:

@LeSeulArtichaut
Copy link
Contributor

I see two path to solving this bug:

  1. Add an option for rustc_hir_pretty::param_to_string to not display the mutability in patterns
  2. Just revert Get rid of custom pretty-printing in rustdoc #80799

cc @jyn514 what do you think?

@jyn514
Copy link
Member

jyn514 commented Jan 24, 2021

I would prefer to go for 1, there's no reason to have two completely different functions for pretty-printing.

@camelid camelid added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 5, 2021
@camelid
Copy link
Member

camelid commented Feb 5, 2021

Assigning P-medium and removing I-prioritize as discussed in the prioritization working group.

LeSeulArtichaut added a commit to LeSeulArtichaut/rust that referenced this issue Feb 10, 2021
@camelid camelid added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Feb 12, 2021
@camelid
Copy link
Member

camelid commented Feb 12, 2021

(now a beta regression)

@jyn514 jyn514 added this to the 1.51.0 milestone Feb 12, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this issue Feb 12, 2021
…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`
@bors bors closed this as completed in 327762f Feb 12, 2021
Mark-Simulacrum pushed a commit to Mark-Simulacrum/rust that referenced this issue Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
5 participants