report const_err on all expressions that can fail#33214
report const_err on all expressions that can fail#33214bors merged 7 commits intorust-lang:masterfrom
const_err on all expressions that can fail#33214Conversation
|
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
i64rightThis 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--$expris treated exactly like$expr(which is kinda wrong, but mathematically right).r? @eddyb