Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRefCell<Option<Heap<T>>> is easy to misuse #25726
Open
Labels
Comments
|
One option: build a wrapper type that supports this pattern safely ( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code like this is subtly incorrect:
Moving around Heap values invalidates pointers; the correct way to use this is to set the
Some(Heap::default()), then useborrow_mut().as_ref().unwrap().set(...)to update the value after it has settled in memory.