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

New lint: redundant_slicing #6528

Merged
merged 5 commits into from
Jan 17, 2021
Merged

New lint: redundant_slicing #6528

merged 5 commits into from
Jan 17, 2021

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Dec 31, 2020

changelog: Added lint: redundant_slicing
fixes #6519

This will trigger on any type which implements Index<RangeFull> that returns the input type. This would be a false positive if the implementation does something other than return itself, but I'm not sure why you would ever want to do that.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 31, 2020
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

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

but I'm not sure why you would ever want to do that.

If I learned anything from maintaining Clippy, it is that someone out there always does something you don't expect. But your argument that this should be noted in the code is correct. And what better way to note this than with a clippy-allow?

clippy_lints/src/redundant_slicing.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Jan 4, 2021

☔ The latest upstream changes (presumably #6538) made this pull request unmergeable. Please resolve the merge conflicts.

@Jarcho Jarcho force-pushed the redundant_slicing branch from f263f49 to dd67407 Compare January 5, 2021 15:11
clippy_lints/src/lib.rs Outdated Show resolved Hide resolved
@Jarcho Jarcho force-pushed the redundant_slicing branch from dd67407 to c379af0 Compare January 8, 2021 04:41
@bors
Copy link
Contributor

bors commented Jan 15, 2021

☔ The latest upstream changes (presumably #6500) made this pull request unmergeable. Please resolve the merge conflicts.

@Jarcho Jarcho force-pushed the redundant_slicing branch from be09693 to 9146a77 Compare January 15, 2021 21:41
@flip1995
Copy link
Member

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented Jan 17, 2021

📌 Commit 9146a77 has been approved by flip1995

@bors
Copy link
Contributor

bors commented Jan 17, 2021

⌛ Testing commit 9146a77 with merge 990e2b3...

@bors
Copy link
Contributor

bors commented Jan 17, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 990e2b3 to master...

@bors bors merged commit 990e2b3 into rust-lang:master Jan 17, 2021
@Jarcho Jarcho deleted the redundant_slicing branch April 6, 2021 16:02
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.

lint slicing of entire slices
5 participants