Warning
This post was published 110 days ago. The information described in this article may have changed.
Since RefCell<T>
allows for interior mutability, then obtaining a mut &T
using RefCell::borrow_mut()
, we can do a move via mem::replace()
, and that too in (apparently) safe code; whereas documentation for Pin<T>
states, that it isn't possible for safe code to obtain a reference to &mut T
.
Intutively, it appears that it violates the pin gurantee; or, am I wrong here?
2 posts - 2 participants
🏷️ rust_feed