Two neat explanations I've picked up from @stjepang:
- 'static lifetime means there's no borrows
- Unpin means there's no self-referential fields (which is a specific kind of borrow)
Has helped a lot when trying to reason about both!
-
-
Processes have stacks, heaps, static data, and code. Normally lifetimes refer to a bound of stack frames: the actual data exists on a frame <= a ref 'static is anything that isn't on a stack frame at all: either on the heap or in the static region of the process's address space.
-
'static things can be borrowed infinitely by anything on the stack, because the heap and static data live longer than any stack
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.