Closed
Description
From this reddit thread.
std::rc::try_unwrap()
returns Err
if the Rc
is not unique, which includes weak references. This fails intuition as the logic is the same as when the last Rc
is dropped, which only considers strong references when deciding whether to drop the contained value, except it keeps the contained value from being destroyed. I fail to see how it is unsafe to unwrap when only weak references remain.
Metadata
Metadata
Assignees
Labels
No labels