-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
overlapping_range_endpoints false positive #117648
Comments
Yep, that's somewhat intentional. The true reason is that detecting this properly would require more work from exhaustiveness checking, which is a performance cost I predicted we wouldn't want to pay. That said I haven't actually measured anything so I could be wrong. The rationalization is that forcing the user to clarify intent could be worth it for future readers. One way to clarify would be to write I won't close this as |
This is showing up in a way that will cause confusion for devs in our codebase. Would it be possible to move this warning in its current form to a clippy lint given that it has easily confirmed false positives? EDIT: I posted too quickly. Hadn't realized that this was a modification of an existing warning rather than a totally new warning. Same resolution would be preferred (move FP-prone portion to a Clippy lint if eliminating FPs isn't feasible at the moment), although maybe splitting out the behavior of the warning is more labor-intensive than just moving it in its entirety? The addition of false positives to a previously reliable warning is unfortunate from a workaround perspective since an
Note that that workaround isn't available on stable. Other note: I wish I had the time + knowledge to help with this. Sorry to only raise problems and not offer help on an actual fix 😞 |
It's unfortunately not possible to split off the FP-prone portion. The whole lint is FP-prone from the way it is currently computed :/ |
This turned out to be pretty easy to implement! (#119396) Let's see what the perf report says. |
…try> Experiment: track overlapping ranges precisely The `overlapping_range_endpoints` lint has false positives, e.g. rust-lang#117648. I expected that removing these false positives would have too much of a perf impact but never measured it. This PR is an experiment to see if the perf loss is manageable. r? `@ghost`
…try> Experiment: track overlapping ranges precisely The `overlapping_range_endpoints` lint has false positives, e.g. rust-lang#117648. I expected that removing these false positives would have too much of a perf impact but never measured it. This PR is an experiment to see if the perf loss is manageable. r? `@ghost`
…try> Experiment: track overlapping ranges precisely The `overlapping_range_endpoints` lint has false positives, e.g. rust-lang#117648. I expected that removing these false positives would have too much of a perf impact but never measured it. This PR is an experiment to see if the perf loss is manageable. r? `@ghost`
The perf report reports a perf improvement x) I'm glad I tried, the PR will likely get merged soon. |
…affleLapkin Exhaustiveness: track overlapping ranges precisely The `overlapping_range_endpoints` lint has false positives, e.g. rust-lang#117648. I expected that removing these false positives would have too much of a perf impact but never measured it. This PR is an experiment to see if the perf loss is manageable. r? `@ghost`
Fixed by #119396 🎉 |
Code
Current output
Desired output
Rationale and extra context
No response
Other cases
No response
Anything else?
this is only occurring on nightly (at least as of 2023-11-01, i haven't tested anything sooner)
The text was updated successfully, but these errors were encountered: