This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit e7bdc5f
committed
Auto merge of rust-lang#114330 - RalfJung:dagling-ptr-deref, r=oli-obk
don't UB on dangling ptr deref, instead check inbounds on projections
This implements rust-lang/reference#1387 in Miri. See that PR for what the change is about.
Detecting dangling references in `let x = &...;` is now done by validity checking only, so some tests need to have validity checking enabled. There is no longer inherently a "nodangle" check in evaluating the expression `&*ptr` (aside from the aliasing model).
r? `@oli-obk`
Based on:
- rust-lang/reference#1387
- rust-lang#115524File tree
142 files changed
+986
-845
lines changed- compiler
- rustc_abi/src
- rustc_const_eval
- src
- const_eval
- interpret
- rustc_middle/src/mir
- interpret
- src/tools/miri
- src
- borrow_tracker
- stacked_borrows
- tree_borrows
- concurrency
- shims
- unix
- linux
- windows
- x86
- tests
- fail-dep/shims
- fail
- alloc
- concurrency
- dangling_pointers
- data_race
- function_pointers
- intrinsics
- provenance
- unaligned_pointers
- pass
- tests/ui
- const-generics/generic_const_exprs
- const-ptr
- consts
- const-eval
- heap
- const-mut-refs
- extra-const-ub
- error-codes
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
142 files changed
+986
-845
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
684 | 685 | | |
685 | 686 | | |
686 | 687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | | - | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | | - | |
| 78 | + | |
77 | 79 | | |
78 | | - | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
389 | 390 | | |
390 | 391 | | |
391 | 392 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | 393 | | |
402 | 394 | | |
403 | 395 | | |
| |||
459 | 451 | | |
460 | 452 | | |
461 | 453 | | |
462 | | - | |
463 | 454 | | |
464 | 455 | | |
465 | 456 | | |
| |||
568 | 559 | | |
569 | 560 | | |
570 | 561 | | |
571 | | - | |
| 562 | + | |
572 | 563 | | |
573 | 564 | | |
| 565 | + | |
574 | 566 | | |
575 | 567 | | |
576 | 568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | 355 | | |
357 | 356 | | |
358 | 357 | | |
| |||
571 | 570 | | |
572 | 571 | | |
573 | 572 | | |
574 | | - | |
575 | | - | |
| 573 | + | |
576 | 574 | | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | 575 | | |
585 | 576 | | |
586 | 577 | | |
| |||
589 | 580 | | |
590 | 581 | | |
591 | 582 | | |
592 | | - | |
| 583 | + | |
593 | 584 | | |
594 | 585 | | |
595 | | - | |
596 | 586 | | |
597 | 587 | | |
598 | 588 | | |
| |||
621 | 611 | | |
622 | 612 | | |
623 | 613 | | |
624 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
625 | 618 | | |
626 | 619 | | |
627 | 620 | | |
| |||
677 | 670 | | |
678 | 671 | | |
679 | 672 | | |
680 | | - | |
| 673 | + | |
681 | 674 | | |
682 | 675 | | |
683 | 676 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| 439 | + | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
| |||
0 commit comments