This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit d9b4598
committed
Auto merge of rust-lang#135753 - compiler-errors:from-ty-const, r=oli-obk
Get rid of `mir::Const::from_ty_const`
This function is strange, because it turns valtrees into `mir::Const::Value`, but the rest of the const variants stay as type system consts.
All of the callsites except for one in `instsimplify` (array length simplification of `ptr_metadata` call) just go through the valtree arm of the function, so it's easier to just create a `mir::Const` directly for those.
For the instsimplify case, if we have a type system const we should *keep* having a type system const, rather than turning it into a `mir::Const::Value`; it doesn't really matter in practice, though, bc `usize` has no padding, but it feels more principled.File tree
10 files changed
+21
-98
lines changed- compiler
- rustc_middle/src
- mir
- ty
- rustc_mir_transform/src
- rustc_pattern_analysis/src
- rustc_smir/src/rustc_smir
- convert
- src/tools/clippy
- clippy_lints/src/matches
- clippy_utils/src
10 files changed
+21
-98
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | 463 | | |
475 | 464 | | |
476 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
1183 | 1184 | | |
1184 | 1185 | | |
1185 | 1186 | | |
1186 | | - | |
| 1187 | + | |
1187 | 1188 | | |
1188 | 1189 | | |
1189 | | - | |
| 1190 | + | |
1190 | 1191 | | |
1191 | 1192 | | |
1192 | 1193 | | |
1193 | 1194 | | |
1194 | | - | |
| 1195 | + | |
1195 | 1196 | | |
1196 | 1197 | | |
1197 | | - | |
| 1198 | + | |
1198 | 1199 | | |
1199 | 1200 | | |
1200 | 1201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1178 | 1178 | | |
1179 | 1179 | | |
1180 | 1180 | | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
| 1181 | + | |
1186 | 1182 | | |
1187 | 1183 | | |
1188 | 1184 | | |
| |||
1492 | 1488 | | |
1493 | 1489 | | |
1494 | 1490 | | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
| 1491 | + | |
1500 | 1492 | | |
1501 | 1493 | | |
1502 | 1494 | | |
| |||
1518 | 1510 | | |
1519 | 1511 | | |
1520 | 1512 | | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
| 1513 | + | |
1526 | 1514 | | |
1527 | 1515 | | |
1528 | 1516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
798 | | - | |
799 | | - | |
| 797 | + | |
800 | 798 | | |
801 | 799 | | |
802 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
455 | | - | |
456 | | - | |
| 454 | + | |
| 455 | + | |
457 | 456 | | |
458 | 457 | | |
459 | 458 | | |
460 | 459 | | |
461 | | - | |
462 | | - | |
463 | | - | |
| 460 | + | |
464 | 461 | | |
465 | 462 | | |
466 | 463 | | |
| |||
472 | 469 | | |
473 | 470 | | |
474 | 471 | | |
475 | | - | |
476 | | - | |
477 | 472 | | |
478 | 473 | | |
479 | 474 | | |
480 | | - | |
481 | | - | |
| 475 | + | |
| 476 | + | |
482 | 477 | | |
483 | 478 | | |
484 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | 417 | | |
460 | 418 | | |
461 | 419 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
40 | | - | |
| 38 | + | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | | - | |
46 | | - | |
| 43 | + | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
| |||
1584 | 1583 | | |
1585 | 1584 | | |
1586 | 1585 | | |
1587 | | - | |
1588 | | - | |
| 1586 | + | |
| 1587 | + | |
1589 | 1588 | | |
1590 | 1589 | | |
1591 | 1590 | | |
| |||
1597 | 1596 | | |
1598 | 1597 | | |
1599 | 1598 | | |
1600 | | - | |
1601 | | - | |
| 1599 | + | |
| 1600 | + | |
1602 | 1601 | | |
1603 | 1602 | | |
1604 | 1603 | | |
| |||
0 commit comments