Skip to content

Commit 8e8c230

Browse files
Update src/frequently-requested-changes.md
Co-authored-by: scottmcm <[email protected]>
1 parent d5632be commit 8e8c230

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/frequently-requested-changes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ can be manually offset by the size of the type to access the next array element.
205205
code may also assume that overwriting trailing padding is allowed, which would conflict with
206206
the repurposing of such padding for data storage.
207207

208+
While changing the fundamental layout guarantees seems unlikely, it may be reasonable to add additional inspection APIs for code that wishes to opt into the possibility of copying smaller parts of an object -- an API to find out that copying only bytes `0..1` of `Overaligned` is sufficient might still be reasonable, or something `size_of_val`-like that could be variant-aware to say which bytes are sufficient for copying a particular instance.
209+
208210
Cross-referencing to other discussions:
209211

210212
* https://github.com/rust-lang/rfcs/issues/1397

0 commit comments

Comments
 (0)