|
|
|
|
|
by cesarb
406 days ago
|
|
> but that part of the description doesn't catch how objects are automatically freed once the last reference to them (the owning one) is dropped. You're confusing the borrow checker with RAII. Dropping the last reference to an object does nothing (and even the exclusive &mut is not an "owning" reference). Dropping the object itself is what automatically frees it. See also Box::leak. |
|
With only RAII you don't get the last reference part.
Yes, there are exceptions, it's a roughly correct analogy not a precise description.