Is there a mechanism by which one can limit pointers to a specific region in memory?
We cannot afaik forbid borrows from pointing to anywhere in memory. We could maybe limit ourselves to 'static
types, but this does not prevent &'static
borrows.
We could've an Allocator
which only created pointers into the target region, but we cannot necessarily preclude a user defined type using a different Allocator
internally.
You'd just want an unsafe trait which made these promises I guess? I'm wondering specifically about mmapped files which one always mmaps into the same memory region, and contain internal owned pointers, but not necessarily internal borrows.