[arithmetic_side_effects] Fix #10252#10309
Conversation
|
r? @giraffate (rustbot has picked a reviewer for you, use r? to override) |
|
Hey @c410-f3r regarding the changelog entry, would you mind telling me what CTFT stands for? Based on the linked issue, I understand that this change allows shifts, if they're verifiably inside the bounds of the shifted integer. Is that correct? |
CTFE -> Constant Time Function Evaluator
Yes, Rustc is smart enough to handle out-of-bounds shifts for known integers. Actually, the term CTFE is being abused and I am not totally sure if this specific part is indeed handled by the CTFE. It is probably best to just say compiler or Rustc instead. |
|
☔ The latest upstream changes (presumably #10310) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Thank you for the explanation! :) |
|
ping @giraffate |
|
I'll review this in a few days. |
|
@bors r+ Thanks! |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fix #10252
At least for integers, shifts are already handled by the compiler.
changelog: [
arithmetic_side_effects]: No longer lints on right or left shifts with constant integers, as the compiler warns about them.#10309