Feature: Rc::clone_raw
(and for Arc)
#48108
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
When using
from_raw
/into_raw
functions withRc
, you often want to obtain a new reference to a raw pointer, without taking ownership. At the moment you have to do this dance:This is quite error prone and makes little sense to anyone trying to read the code. It would be better if the standard library had
clone_raw
built in forRc
andArc
, and possibly for their weak variants.The text was updated successfully, but these errors were encountered: