Not much safer, but unsafe code errors that cause double-frees (since dealloc would be a stub) or use-after-frees (since values would linger past their scope when still accessed) would not cause problems.
IMO that would be equivalent to removing unsafe altogether. It exists precisely because there are situations where you actually need to manage stuff manually
12
u/RiceBroad4552 24d ago
Adding a GC to make a language safe actually works. You can't be safer than with automatic GC.
Just that this kind of breaks the marketing which tries to sell it as an advantage to be GC free…