This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 254d910
committed
Auto merge of rust-lang#116542 - the8472:slice-ref-len-validity, r=<try>
Add range metadata to slice lengths
This adds range information to the slice-len in fat pointers if we can conservatively determine that the pointee is not a ZST without having to normalize the pointee type.
I only intended to pass the `!range` to llvm but apparently this also lets the length in fat pointers be used for its niches 😅.
Ideally this would use the naive-layout computation from rust-lang#113166 to calculate a better approximation of the pointee size, but that PR got reverted.File tree
16 files changed
+308
-65
lines changed- compiler
- rustc_hir_typeck/src
- rustc_hir/src
- rustc_middle/src/ty
- rustc_ty_utils/src
- library
- alloc/src/vec
- core/tests
- tests
- codegen
- intrinsics
- mir-opt/dataflow-const-prop
- rustdoc
- ui
- issues
- stats
- transmute
16 files changed
+308
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3855 | 3855 | | |
3856 | 3856 | | |
3857 | 3857 | | |
3858 | | - | |
3859 | 3858 | | |
3860 | 3859 | | |
| 3860 | + | |
3861 | 3861 | | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
3862 | 3865 | | |
| 3866 | + | |
| 3867 | + | |
3863 | 3868 | | |
| 3869 | + | |
3864 | 3870 | | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
3865 | 3874 | | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
3866 | 3878 | | |
3867 | 3879 | | |
3868 | 3880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
87 | 98 | | |
88 | 99 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
| 323 | + | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| |||
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
375 | | - | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
376 | 395 | | |
377 | 396 | | |
378 | 397 | | |
| |||
449 | 468 | | |
450 | 469 | | |
451 | 470 | | |
452 | | - | |
| 471 | + | |
453 | 472 | | |
454 | 473 | | |
455 | 474 | | |
| |||
459 | 478 | | |
460 | 479 | | |
461 | 480 | | |
| 481 | + | |
462 | 482 | | |
463 | 483 | | |
464 | 484 | | |
| |||
469 | 489 | | |
470 | 490 | | |
471 | 491 | | |
472 | | - | |
473 | | - | |
474 | | - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
475 | 495 | | |
476 | 496 | | |
477 | 497 | | |
| |||
492 | 512 | | |
493 | 513 | | |
494 | 514 | | |
495 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
496 | 519 | | |
497 | 520 | | |
498 | 521 | | |
| |||
0 commit comments