my understanding of the new ownership specifiers (
borrowing) is they were intended to obsolete the old ARC hints like
__shared. but i am having a lot of trouble migrating
inits that take
borrowing introduces a lot of restrictions that
__shared does not have.
__shared still have a place in new 5.9+ code?
__shared maintains the behavior it had already to provide source compatibility, so compared to
borrowing, it doesn't introduce the no-implicit-copy restriction on the parameter binding, and it also has some ABI differences. It would be better IMO to prefer
borrowing for new code. You can use the
copy x operator with a borrowing parameter to allow explicit copies where necessary.
ah, that’s what i needed!
aside: we truly have terrible pagerank…
We should probably also offer
copy x as a fixit when diagnosing borrow issues with borrowing/consuming parameters too.