-
Notifications
You must be signed in to change notification settings - Fork 13.3k
report const_err
on all expressions that can fail
#33214
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
Conversation
Disqualifying expressions leads to ICEs like the one Travis found in |
Associated constants aren't implemented fully in early const eval
yea... that's because associated constants aren't implemented in const eval, only in trans/consts. I decided to err on the safe side and ignored all errors due to non-const-path. This kind of distinction will become irrelevant with miri anyway. So for now we report fewer errors than we could. |
this might introduce subtle bugs to code generation
98991ab
to
d3c489c
Compare
@bors r+ |
📌 Commit d3c489c has been approved by |
⌛ Testing commit d3c489c with merge ef4379f... |
💔 Test failed - auto-linux-64-opt-rustbuild |
@oli-obk Forgot to update |
yep. done. |
@bors r+ |
📌 Commit 5cdcad9 has been approved by |
report `const_err` on all expressions that can fail also a drive-by fix for reporting an "overflow in shift *left*" when shifting an `i64` *right* This increases the warning noise for shifting by more than the bitwidth and for `-T::MIN`. I can silence the bitwidth warnings explicitly and fix the const evaluator to make sure `--$expr` is treated exactly like `$expr` (which is kinda wrong, but mathematically right). r? @eddyb
💔 Test failed - auto-win-gnu-32-opt |
Huh? The error occurred on |
@bors: retry |
also a drive-by fix for reporting an "overflow in shift left" when shifting an
i64
rightThis increases the warning noise for shifting by more than the bitwidth and for
-T::MIN
. I can silence the bitwidth warnings explicitly and fix the const evaluator to make sure--$expr
is treated exactly like$expr
(which is kinda wrong, but mathematically right).r? @eddyb