This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 261505a
authored
Rollup merge of rust-lang#72350 - danielhenrymantilla:doc_warn_against_adjacent_slice_concat, r=RalfJung
Improve documentation of `slice::from_raw_parts`
This is to provide a more explicit statement against a code pattern that
many people end up coming with, since the reason of it being unsound
comes from the badly known single-allocation validity rule.
Providing that very pattern as a counter-example could help mitigate that.
See also: https://internals.rust-lang.org/t/pre-rfc-add-join-seq-method-to-slices-and-strs/11936/13
r? @RalfJung1 file changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5740 | 5740 | | |
5741 | 5741 | | |
5742 | 5742 | | |
5743 | | - | |
| 5743 | + | |
| 5744 | + | |
5744 | 5745 | | |
5745 | 5746 | | |
5746 | 5747 | | |
| |||
5773 | 5774 | | |
5774 | 5775 | | |
5775 | 5776 | | |
| 5777 | + | |
| 5778 | + | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
| 5783 | + | |
| 5784 | + | |
| 5785 | + | |
| 5786 | + | |
| 5787 | + | |
| 5788 | + | |
| 5789 | + | |
| 5790 | + | |
| 5791 | + | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
| 5796 | + | |
| 5797 | + | |
| 5798 | + | |
| 5799 | + | |
| 5800 | + | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
| 5804 | + | |
5776 | 5805 | | |
5777 | 5806 | | |
5778 | 5807 | | |
| |||
0 commit comments