Eager finalization and smart pointers

I think the problem here is that unsafe_load(r[]) gets linearized to

_1 = r[]
# <------- No more references to r, so the finalizer gets inserted here!
unsafe_load(_1)
# <------- You actually want the finalizer to be inserted here
1 Like