-
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
match_same_arms
does not take lifetimes into account
#8919
Comments
@rustbot claim |
the suggestion does not cause error anymore shortly after this was posted... I'm assuming it was fixed in this PR, as the error exists in nightly-2022-06-07 but not in nightly-2022-06-08. So, I'm closing this for now, unless there is something that I missed when testing the suggested code here, you can always pointing it out and re-open this~ (Also sorry for the long wait, I forgot to state the reason of unassigning myself half a year ago 🤦♂️ , luckily this pops up as I'm now trying to re-evaluate all lifetime related issues~) |
Should we add a test to clippy? |
good idea 👍, do you want to submit a pr? it's totally fine if you don't~ |
Since I don't have the clippy repo on my pc right now, it would be easier if you could do it, please :) |
[`match_same_arms`]: add a test case with lifetimes as reminded by: #8919 --- changelog: none
Summary
Taken from this real-world example: https://github.com/rust-lang/log/blob/7fb28c36c7a418912612ab37ab49bd4ca1a3a7f5/src/lib.rs#L812-L826
Lint Name
match_same_arms
Reproducer
I tried this code:
I saw this happen:
Problem is, that if I do that:
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: