3 ms·
This looks pretty unsound.. :/ Getting a &'static mut T means that you're allowed to keep the reference around forever, beyond the scope of the call. To be sou
by Nullabillity 6y ago
This looks pretty unsound.. :/
Getting a &'static mut T means that you're allowed to keep the reference around forever, beyond the scope of the call. To be sound that means that the calling function is never allowed to use the reference again, not even to drop it.
The only sound way to even get a &'static mut T would be to leak a heap allocation (which this library explicitly forbids itself from).