-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
initial clippy::ref_patterns implementation #10736
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Alexendoo (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
☔ The latest upstream changes (presumably #10716) made this pull request unmergeable. Please resolve the merge conflicts. |
The clippy packages aren't in a cargo workspace due to being part of the |
I see, thanks. I'll run that and see what I can fix. |
It's hard to produce a specific suggestion since it's often not as simple as putting an let x = (String::new(), String::new());
let (a, ref b) = x;
You could check where |
@rustbot review |
Should I do anything on my end to squash and rebase? |
Yeah though actually one last thing also, could you change the lint + filenames to be For the rebase/squash it would be something along the lines of git fetch upstream
git rebase -i upstream/master Then changing the |
Err, that doesn't include the rename commit. I'll fix that first |
Great, thanks! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This implements a new lint that discourages the use of the
ref
keyword as outlined in #9010. I think there are still some things to improve about this lint, but I need some feedback before I can implement those.Maybe it's desirable that a quick fix is listed too, instead of a genericavoid using the ref keyword
lint.let ref x = y
already has a lint (clippy::toplevel_ref_arg
). This implementation will report this too, so you get two lints for the same issue, which is not great. I don't really know a way around this though.cargo clippy -- -D clippy::all -D clippy::pedantic
and got no output, so I'm not sure why this is.Any help with these would be greatly appreciated.
fixes #9010
changelog: [
ref_patterns
]: newly added lint