-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Tracking Issue: Fix auto-applicable lint suggestions by using multipart suggestions #13099
Comments
Hey @flip1995, I just sent a PR to solve a problem that you mentioned in this issue. Thank you! |
Add a test for ice-3717.rs this PR is a part of #13099. Based on the changes introduced in #13098 for introduce ui_test, we will update the uitest output. This is a fix for `ice-3717.rs`. Although fixes have already been made in #13216, it seems that he is a first-time contributor. I thought it might be better for him to refer to my PR, so I created it accordingly. Since this is my first contribution in a while, please let me know if there are any issues or required changes. changelog: None r! `@flip1995`
Add a test for ice-3717.rs this PR is a part of #13099. Based on the changes introduced in #13098 for introduce ui_test, we will update the uitest output. This is a fix for `ice-3717.rs`. Although fixes have already been made in #13216, it seems that he is a first-time contributor. I thought it might be better for him to refer to my PR, so I created it accordingly. Since this is my first contribution in a while, please let me know if there are any issues or required changes. changelog: none r! `@flip1995`
Copying a comment by
|
I pushed a change to address this for |
I pushed a change for |
Hey @flip1995 , if you have a chance, do the PRs i've pushed look good to you? I'm happy to do more of these but it looks like the PR approval lag is high and I am hesitant to continue until i've got a positive signal! |
This should address #13099 for the `derivable_impls` test. As I've not contributed to clippy before, I'd like to make sure i'm on the right track before doing more :) changelog: [`derivable_impls`]: Use multipart_suggestion to aggregate feedback
Sorry for not replying. I'm also pretty backed up right now. I just found some time for giving your PRs a look. They LGTM (and I already merged one 🎉 ). |
No worries - thanks for finding the time! I'll knock a few more off in the coming days 💪 |
I've started on |
Hey @flip1995 , I reckon i've got my head around these. If you're happy for me to pick up the rest, feel free to assign the issue to me! |
You can do PR-per lint, that's easier to review. I'll try to get to reviewing them as fast as I can, but that is currently quite slow. Sorry about that 😐 |
FYI: You can self-assign issues by writing a comment with
in it. |
@rustbot claim |
This addresses #13099 for the manual_split_once test, using the str_splitn lint. changelog: [str_splitn]: Updated str_splitn to use multipart_suggestions where appropriate
This addresses #13099 for the manual_async_fn test. changelog: [manual_async_fn]: Updated manual_async_fn to use multipart_suggestions where appropriate
This should address #13099 for the derivable_impls test. As this combines everything into a single multipart_suggestion, the feedback message is a little less "targeted" than it was before, but now it provides a complete`--fix`able suggestion - e.g.: ``` error: this binding can be a slice pattern to avoid indexing --> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:5:17 | LL | if let Some(slice) = slice { | ^^^^^ | note: the lint level is defined here --> tests/ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs:1:9 | LL | #![deny(clippy::index_refutable_slice)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the binding and indexed access with a slice pattern | LL ~ if let Some([_, _, _, _, _, _, _, slice_7, ..]) = slice { LL | LL | // This would usually not be linted but is included now due to the LL | // index limit in the config file LL ~ println!("{}", slice_7); | ``` changelog: [index_refutable_slice]: Fixed multipart_suggestions to provide correct rustfix-able lint
Description
#13098 introduced
@no-rustfix
annotations, that can be removed by changing the suggestion to a multipart suggestion://@no-rustfix: need to change the suggestion to a multipart suggestion
The affected test files are:
ui-toml/max_suggested_slice_pattern_length/index_refutable_slice.rs
ui/crashes/ice-3717.rs
ui/derivable_impls.rs
ui/index_refutable_slice/if_let_slice_binding.rs
ui/index_refutable_slice/slice_indexing_in_macro.rs
ui/let_unit.rs
ui/manual_assert.rs
ui/manual_async_fn.rs
ui/manual_split_once.rs
ui/match_same_arms2.rs
ui/significant_drop_tightening.rs
ui/unnecessary_iter_cloned.rs
ui/unnecessary_to_owned.rs
To fix some of those:
@no-rustfix
annotationmultipart_suggestion
over the current implementationVersion
No response
Additional Labels
No response
The text was updated successfully, but these errors were encountered: