You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider foo.map_ref_mut(|f| *f = new_f), it will drop the old f. If the old f contains a Box, it will cause a double-free issue. Even f is trivially droppable, the modification won't be applied to foo, the compact f. We need to find a way to prevent users from modifying f itself or mark this function as unsafe or invent a new API to replace it.
The text was updated successfully, but these errors were encountered:
Consider
foo.map_ref_mut(|f| *f = new_f)
, it will drop the oldf
. If the oldf
contains aBox
, it will cause a double-free issue. Evenf
is trivially droppable, the modification won't be applied tofoo
, the compactf
. We need to find a way to prevent users from modifyingf
itself or mark this function asunsafe
or invent a new API to replace it.The text was updated successfully, but these errors were encountered: