-
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 redundant_pattern_matching lint #5511
Fix redundant_pattern_matching lint #5511
Conversation
856bb34
to
ef9c38c
Compare
@bors r+ thanks! |
📌 Commit ef9c38c has been approved by |
Fix redundant_pattern_matching lint fixes #5504 changelog: Fix suggestion in `redundant_pattern_matching` for macros.
💔 Test failed - checks-action_test |
github was unavailable, so smb need to retry. Hm, interesting, do I have rights to do it. |
@bors retry |
@alex-700: 🔑 Insufficient privileges: not in try users |
Fix redundant_pattern_matching lint fixes #5504 changelog: Fix suggestion in `redundant_pattern_matching` for macros.
💔 Test failed - checks-action_dev_test |
Let's try again =) @bors retry |
Fix redundant_pattern_matching lint fixes #5504 changelog: Fix suggestion in `redundant_pattern_matching` for macros.
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.
I have to take a closer look at the span situation. I think I finally understood what @alex-700 meant in the discussion in the issue and that there is indeed a bug in the lowering.
// while let ... = ... { ... } | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
let expr_span = arms[1].pat.span; |
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.
Wait, what? I don't trust this at all. There is no test for if let ... {} else if let {}
. I think this could break.
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.
I think this could break.
I don't think so. I'll add this test.
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.
done
@bors r- |
8fa9d63
to
6b256aa
Compare
@alex-700 The |
- now it gives correct suggestion in case of macros - better tests - remove a couple of non-relevant tests
6b256aa
to
69fe6b4
Compare
Now that suggestion building looks more trustworthy and stable. Thanks! :) @bors r+ |
📌 Commit 69fe6b4 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes #5504
changelog: Fix suggestion in
redundant_pattern_matching
for macros.