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

fix suggestion for assignments have enclosing parentheses under needless_late_init #14169

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

lapla-cogito
Copy link
Contributor

fixes #9895

changelog: [needless_late_init]: correct suggestion when assignments have enclosing parentheses

@rustbot
Copy link
Collaborator

rustbot commented Feb 7, 2025

r? @y21

rustbot has assigned @y21.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 7, 2025

fn issue9895() {
let r;
(r = 5);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These patterns can also be ignored, but I thought it wouldn't be a problem to remove the enclosing parentheses here, since an assignment returns the unit value.

@lapla-cogito
Copy link
Contributor Author

Rebased to address the recent changes in error annotation.

@lapla-cogito lapla-cogito force-pushed the issue_9895 branch 3 times, most recently from c618387 to 62c41e2 Compare February 22, 2025 15:58
@lapla-cogito
Copy link
Contributor Author

@y21 Could you take a look at this when you have some time?

Copy link
Member

@y21 y21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, sorry for the wait!

@y21 y21 added this pull request to the merge queue Mar 19, 2025
Merged via the queue into rust-lang:master with commit 221ae5f Mar 19, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FP needless-late-init: assignment inside brace expr
3 participants