Commit 236ef9b
Rollup merge of rust-lang#134606 - RalfJung:ptr-copy-docs, r=Mark-Simulacrum
ptr::copy: fix docs for the overlapping case
Fixes rust-lang/unsafe-code-guidelines#549
As discussed in that issue, it doesn't make any sense for `copy` to read a byte via `src` after it was already written via `dst`. The entire point of this method is that is copies correctly even if they overlap, and that requires always reading any given location before writing it.
Cc `@rust-lang/opsem`1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4364 | 4364 | | |
4365 | 4365 | | |
4366 | 4366 | | |
4367 | | - | |
4368 | | - | |
4369 | | - | |
4370 | | - | |
| 4367 | + | |
4371 | 4368 | | |
4372 | 4369 | | |
4373 | | - | |
| 4370 | + | |
| 4371 | + | |
4374 | 4372 | | |
4375 | 4373 | | |
4376 | 4374 | | |
| |||
0 commit comments