Documentation of Arc::from_raw
is unnecessarily restrictive #106124
Closed as not planned
Description
Location
Arc::from_raw
Summary
Arc::from_raw
mentions that the provided pointer has to have been returned from Arc::into_raw
but it doesn't mention Arc::as_ptr
at all. This disallows many usages that depend on not modifying the reference counter while passing Arc
around in form of a pointer and converting it back by calling Arc::from_raw
on the pointer and wrapping the result inside a ManuallyDrop
(as after one conversion round of Arc::into_raw
-> ManuallyDrop<Arc::from_raw>
-> Arc::as_ptr
would disallow recreating the Arc
through Arc::from_raw
)