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

New lint - `same_length_and_capacity`

Open km274 opened this issue 3 months ago • 23 comments

Fixes rust-lang/rust-clippy#5955

I understand that there's a feature freeze right now. I had started working on this before I was aware of the feature freeze. I don't mind waiting as long as I need to for feedback.

changelog: [same_length_and_capacity]: adds a new lint that checks for usages of from_raw_parts where the same expression is passed for the length and the capacity

Summary Notes

Managed by @rustbot—see help for details

km274 avatar Sep 10 '25 21:09 km274

r? @llogiq

rustbot has assigned @llogiq. 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 Sep 10 '25 21:09 rustbot

Lintcheck changes for e89603e34a0f3c5c4fd63f4c6765f7a00933cbf3

Lint Added Removed Changed
clippy::same_length_and_capacity 71 0 0

This comment will be updated if you push new changes

github-actions[bot] avatar Sep 10 '25 21:09 github-actions[bot]

Oops, I understand why CI failed. I'll take care of that.

km274 avatar Sep 10 '25 21:09 km274

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 Oct 03 '25 21:10 rustbot

@rustbot ready

km274 avatar Oct 03 '25 21:10 km274

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

rustbot avatar Oct 06 '25 21:10 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 Oct 07 '25 01:10 rustbot

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

rustbot avatar Oct 07 '25 16:10 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 Oct 07 '25 20:10 rustbot

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

rustbot avatar Nov 02 '25 09:11 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 Nov 13 '25 22:11 rustbot

:warning: Warning :warning:

  • There are issue links (such as #123) in the commit messages of the following commits. Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.
    • ec8611275cb5a44b6b81695f7264d69788b28190

rustbot avatar Nov 13 '25 22:11 rustbot

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

rustbot avatar Nov 14 '25 14:11 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 Nov 14 '25 16:11 rustbot

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

rustbot avatar Nov 15 '25 00:11 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 Nov 15 '25 00:11 rustbot

The Final Comment Period was opened. It will terminate next Thursday, and unless any concerns are raised that preclude it, I will merge this.

llogiq avatar Nov 16 '25 14:11 llogiq

Sorry for the delay. A ceiling heating at my home fell down, which I luckily was able to avoid being crushed under, but now there's a lot of back and forth with insurance. That said, can you please squash your commits, then I will merge this.

llogiq avatar Nov 29 '25 18:11 llogiq

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

rustbot avatar Dec 02 '25 19:12 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 Dec 08 '25 14:12 rustbot

@llogiq, I'm sorry to hear about your situation, and I hope things are cleaned up around your home soon.

I'm done squashing my commits, but Lintcheck / diff (pull_request) seems like it failed with something out of my control. My instinct is to just rerun the lintcheck jobs, but I don't think I have permission. Could you take a look?

km274 avatar Dec 08 '25 15:12 km274

Sure thing. Looks like the cache layer intermittently failed. Let's see if a re-run fixes it.

llogiq avatar Dec 09 '25 13:12 llogiq

I'm not sure why it failed a second time, but I went through the job history a bit, and it looks like this run successfully restored from the same cache key. Could you rerun it one more time?

km274 avatar Dec 12 '25 02:12 km274

I have tried re-running that job multiple times. It appears the cache for this build server is faulty. I'll try merging anyway.

llogiq avatar Dec 18 '25 13:12 llogiq