-
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
fix suggestion on [map_flatten]
being cropped causing possible information loss
#8520
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @xFrednet (or someone else) soon. Please see the contribution instructions for more information. |
@xFrednet Hi, I wasn't sure if I understand your suggestion throughly, so I did what I could and get stuck with not knowing how to modify Span as well to reflect the modified suggestion string 😆 was I even in the right direction? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xFrednet Hi, I wasn't sure if I understand your suggestion throughly, so I did what I could and get stuck with not knowing how to modify Span as well to reflect the modified suggestion string laughing was I even in the right direction?
The direction is good, I underestimated the effort it can take to span over the first and last three lines. I suggested a solution and added some sources where you can search, if you want to create that suggestion 🙃
Thank you~ |
Thank you for your suggestion again @xFrednet , so far it looks alright, but I just want to wait for some feedback before I proceed to covering check for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You found a very nice solution to span over the surrounding lines. I learned something from this review 👍. I left some comments which should be addressed, but the current version is already a good step, thank you for the work 🙃
[map_flatten]
being cropped causing possible information loss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work. I added some smaller notes that should be easy to fix, and then it's ready to be merged! 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is almost ready to be merged. I'm very pleased with the output, it looks excellent.
Besides the comment, there is one more thing. Clippy follows rustc's no merge-commit policy. The merge commit should be removed before this can be merged into our master. You can do this by dropping the commit and rebasing. You're welcome to ask if you need help with that.
Another small optional NIT. I would change the changelog entry to:
changelog: [`map_flatten`]: Long suggestions will now be splitup into two help messages
35f7c45
to
b64ecc0
Compare
add new function `span_lint_and_sugg_` for edges in `clippy_utils::diagnostics`
Looks good to me, thank you for the work! I hope you also had fun while working on this. 🙃 @bors r+ |
📌 Commit 5b6295d has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes #8506
Multi-line suggestion given by the lint is missing its bottom part, which could potentially contains useful information about the fix.
changelog: [
map_flatten
]: Long suggestions will now be splitup into two help messages