|
|
Log in / Subscribe / Register

Pointee not on the heap?

Pointee not on the heap?

Posted Apr 23, 2026 19:07 UTC (Thu) by pbonzini (subscriber, #60935)
In reply to: Pointee not on the heap? by tialaramex
Parent article: One Sized trait does not fit all

I *think* the difference is that you can have a &Pointee that points to invalid memory because it's guaranteed that Rust code will never actually access the memory. This can only happen by passing it back to another language via FFI, and whoever creates the &Pointee ensures that whoever receives it won't produce undefined behavior.


to post comments

Pointee not on the heap?

Posted Apr 23, 2026 19:43 UTC (Thu) by daroc (editor, #160859) [Link] (1 responses)

I guess I didn't explain this well enough; Pointee is a subset of the current category !Sized. So current Rust code does handle things that would be Pointee.

The point of the RFC is that !Sized is really lumping two separate, useful categories together: SizeOfVal (where we don't know the size based on the type, but we can know the size of some particular value) and Pointee (where we can't know the size at all).

Pointee not on the heap?

Posted Apr 23, 2026 21:22 UTC (Thu) by pbonzini (subscriber, #60935) [Link]

Yes, what I meant is that not knowing the size at all has interesting effects on what constitutes a valid value of a reference.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds