Skip to content

Conversation

ada4a
Copy link
Contributor

@ada4a ada4a commented Oct 3, 2025

Fixes #14681

changelog: [zero_repeat_side_effects]: better identify exprs with side effects

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 3, 2025

r? @dswij

rustbot has assigned @dswij.
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

@ada4a ada4a marked this pull request as draft October 3, 2025 22:52
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 3, 2025
@ada4a ada4a marked this pull request as ready for review October 3, 2025 22:59
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 3, 2025
help: consider performing the side effect separately
|
LL - vec![f(); 0];
LL + { f(); vec![] as std::vec::Vec<i32> };
Copy link
Member

Choose a reason for hiding this comment

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

This is such an ugly suggestion… Never mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I can improve it just a bit -- since the original expression is in a statement, I can safely remove the block around the suggestion. Should I do it in this PR, or in a separate one?

Copy link
Member

Choose a reason for hiding this comment

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

I was going to say in the same PR, but doing it in another PR looks better as it has nothing to do with the current PR. Assign it to me if you take on it.

ada4a added 2 commits October 4, 2025 15:16
- inline `array_span_lint`
- use `match` instead of `if-let`
- give a more descriptive help message
@ada4a ada4a force-pushed the zero_repeat_side_effects branch from de5c437 to adff9ba Compare October 4, 2025 13:23
@samueltardieu samueltardieu disabled auto-merge October 4, 2025 13:27
@samueltardieu samueltardieu added this pull request to the merge queue Oct 4, 2025
Merged via the queue into rust-lang:master with commit 19343bf Oct 4, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 4, 2025
@ada4a ada4a deleted the zero_repeat_side_effects branch October 4, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

confusing clippy suggestion for zero_repeat_side_effects
4 participants