-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor(invalid_upcast_comparisons): move to under operators, simplify
#15956
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
refactor(invalid_upcast_comparisons): move to under operators, simplify
#15956
Conversation
|
rustbot has assigned @samueltardieu. Use |
|
Lintcheck changes for e71b46f
This comment will be updated if you push new changes |
|
Right. I did put the lint under the "not from expansion" branch of |
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.
It's fine to keep them in the same PR, however given that it won't compile after the first commit and the cumulative changes are small, it would probably be best to squash the commits.
73ae142 to
7a76c96
Compare
|
@rustbot ready Left the non-compiling commit separate as per #15925 (comment) |
|
Off-topic: the fact that the |
You can also let it, the reviewers will know what to do. |
Different reviewers, different preferences I guess. I really dislike broken states. Would you please squash them? |
and clean up a bit:
- put the lint functions in the order they're called
- simplify `upcast_comparison_bounds_err`
- It first handled `Eq`/`Ne`, then one pair of cases with `Lt`/Le`,
then another pair of cases with `Lt`/`Le` -- turn that into a single
`match rel`.
- It used a pattern of `if invert { a } else { b }`, which I found to
be hard because of the need to keep in mind the implicit `invert &&`
and `!invert &&` when looking at `a` and `b`. The form
`(invert && a) || (!invert && b)` should be a bit more explicit,
while compiling down to the same thing
- The conditions were already partially written in the order `lb`,
`norm_rhs_val`, `ub` -- change the ones that weren't
7a76c96 to
e71b46f
Compare
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.
Thanks!
The last two commits could arguably be split off into a separate PR -- let me know if that's desired.
changelog: none