mozilla/rust — pull request #8035 by alexcrichton (2013-07-25 06:05:43+00:00)
Title: Remove headers from ~@T and ~[@T] allocations

I don't believe that these are needed in cleanup after all. Because ~T has the same semantics in the compiler regardless of what T is, then there are two cases for the destruction of ~T. One is before the program exits (which is normal), the other is when the program exits during annihilation. It's possible for ~T to be located inside an @ cycle.

Even though there were headers on ~[@T], the value itself was ignored because each of the elements were linked together themselves. Whatever box contains the ~ allocation will have its destructor run when annihilation comes around, subsequently freeing the ~ allocation.

This builds just fine on OSX, and I'm having other unrelated valgrind issues on linux to ensure that there's no leaks, but I'm sure bors will complain at me if there are any.

By the way, thanks to @thestinger's awesome work removing headers previously, this was a super-easy change!