Commit e0d7ed1
committed
Auto merge of #116281 - Nadrieril:eager-const-eval, r=cjgillot
Cleanup number handling in match exhaustiveness
Doing a little bit of cleanup; handling number constants was somewhat messy. In particular, this:
- evals float consts once instead of repetitively
- reduces `Constructor` from 88 bytes to 56 (`mir::Const` is big!)
The `fast_try_eval_bits` function was mostly constructed from inlining existing code but I don't fully understand it; I don't follow how consts work and are evaluated very well.File tree
4 files changed
+206
-139
lines changed- compiler
- rustc_middle/src/mir
- rustc_mir_build/src/thir/pattern
- tests/ui/pattern/usefulness
4 files changed
+206
-139
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
292 | 301 | | |
293 | 302 | | |
294 | 303 | | |
| |||
0 commit comments