rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

New lint: `borrow_mutable_copy`

Open samueltardieu opened this issue 1 year ago • 36 comments

This detects when the result of a block, with a Copy type, is borrowed mutably. The user might not be aware that using a block will borrow a copy instead of the value expression itself.

changelog: [borrow_mutable_copy]: new lint

Close rust-lang/rust-clippy#13967

samueltardieu avatar Jan 11 '25 10:01 samueltardieu

r? @blyxyas

rustbot has assigned @blyxyas. 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 avatar Jan 11 '25 10:01 rustbot

Rebased

samueltardieu avatar Jan 22 '25 23:01 samueltardieu

Rebased

samueltardieu avatar Jan 27 '25 22:01 samueltardieu

r? @clippy

samueltardieu avatar Jan 31 '25 23:01 samueltardieu

Rebased

samueltardieu avatar Feb 03 '25 22:02 samueltardieu

Rebased

samueltardieu avatar Feb 09 '25 22:02 samueltardieu

@flip1995 Anything else needs to be done?

samueltardieu avatar Feb 23 '25 11:02 samueltardieu

I guess the FCP on Zulip. Feel free to start that :)

flip1995 avatar Feb 23 '25 11:02 flip1995

FCP opened on https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/FCP.3A.20copy_then_borrow_mut

samueltardieu avatar Feb 23 '25 12:02 samueltardieu

:umbrella: The latest upstream changes (possibly 8eed35023f26bc45ab86d5b8f080c4025faa58cf) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Apr 16 '25 06:04 rustbot

Rebased

samueltardieu avatar Apr 16 '25 07:04 samueltardieu

Any blocker for this one?

samueltardieu avatar May 07 '25 07:05 samueltardieu

Rebased and updated the Clippy version to 1.88.

samueltardieu avatar May 07 '25 07:05 samueltardieu

Rebased and updated the Clippy version to 1.89.

samueltardieu avatar May 10 '25 20:05 samueltardieu

:umbrella: The latest upstream changes (possibly 7bac114c8645d40291502c0d8028ffd16c7e8c01) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar May 13 '25 05:05 rustbot

I'll do two successive pushes: one to rebase on master, with no change, and one with the changes, so that it is easier to check what has been modified.

samueltardieu avatar May 20 '25 15:05 samueltardieu

Reminder, once the PR becomes ready for a review, use @rustbot ready.

rustbot avatar May 21 '25 05:05 rustbot

I've put it back into suspicious, with MaybeIncorrect applicability.

samueltardieu avatar May 21 '25 05:05 samueltardieu

@rustbot ready

samueltardieu avatar May 21 '25 05:05 samueltardieu

:umbrella: The latest upstream changes (possibly 7ab910f9355e739e3057fec1eea293637473304a) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar May 23 '25 17:05 rustbot

Rebased

samueltardieu avatar May 23 '25 21:05 samueltardieu

:umbrella: The latest upstream changes (possibly d7b27ecbf319446dd9563a433e9694fa3bcd0d8c) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Jun 02 '25 12:06 rustbot

Rebased

samueltardieu avatar Jun 02 '25 12:06 samueltardieu

:umbrella: The latest upstream changes (possibly b379d54c22f9f6b9577075d7f89645ac2498c931) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Jun 05 '25 19:06 rustbot

Should I close this or will it be merged?

samueltardieu avatar Jun 21 '25 12:06 samueltardieu

Updated Rust version to 1.90.0.

samueltardieu avatar Jun 21 '25 13:06 samueltardieu

:umbrella: The latest upstream changes (possibly 368b2355797b13511776f0a35ec4864468b87ece) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Sep 08 '25 08:09 rustbot

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.

rustbot avatar Sep 08 '25 08:09 rustbot

r? clippy

Jarcho avatar Sep 17 '25 07:09 Jarcho

:umbrella: The latest upstream changes (possibly #15731) made this pull request unmergeable. Please resolve the merge conflicts.

rustbot avatar Sep 27 '25 13:09 rustbot