]> git.lizzy.rs Git - rust.git/commit
rustc: Run destructors when dest=Ignore
authorAlex Crichton <alex@alexcrichton.com>
Mon, 7 Apr 2014 22:03:13 +0000 (15:03 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 8 Apr 2014 15:28:54 +0000 (08:28 -0700)
commit0cc257eb42c72d26a151623825ecc6a8074c53cf
tree204a267b1180e3aef4edf76460502e2df021d76e
parent9a33330caaaedb9eef447ae862e9b87e3aa9880f
rustc: Run destructors when dest=Ignore

Previously, if statements of the form "Foo;" or "let _ = Foo;" were encountered
where Foo had a destructor, the destructors were not run. This changes
the relevant locations in trans to check for ty::type_needs_drop and invokes
trans_to_lvalue instead of trans_into.

Closes #4734
Closes #6892
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/controlflow.rs
src/test/run-pass/issue-4734.rs [new file with mode: 0644]
src/test/run-pass/issue-6892.rs [new file with mode: 0644]