▲ | wavemode 4 days ago | |
If you're talking about stack objects, that's what lifetimes are for. If you're talking about heap, you can accomplish that by restricting that the references can't be used to free or invalidate the memory. But you could still allow them to be mutable. |