Added identity_assign_op lint - #17038
Conversation
|
r? @llogiq rustbot has assigned @llogiq. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
There are a few problems with this proposed implementation:
- Ignoring the statement means removing it, not just replacing it with the LHS expression.
- Why is there a TODO in the source?
- User types may implement those operators, and they might not be removable because they can contain side effects.
- Floating points types are ignored.
- Even if the snippet cannot be retrieved, the lint is currently marked
MachineApplicablewhich is not true. - Tests involving macros should be added.
@rustbot author
|
Reminder, once the PR becomes ready for a review, use |
|
In the original issue there was a suggestion to focus on that this may be a bug, rather than that it can be simplified. |
2a135f9 to
53fc2b2
Compare
This comment has been minimized.
This comment has been minimized.
53fc2b2 to
0112416
Compare
This comment has been minimized.
This comment has been minimized.
0112416 to
d340d41
Compare
|
@rustbot ready |
|
I’ve also updated this PR so that If this approach looks good, I can follow up with a separate PR applying the same logic to |
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
changelog: [
identity_assign_op]: new lintfixes #16977