]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7317 : Aatch/rust/no-drop-flag, r=thestinger
authorbors <bors@rust-lang.org>
Tue, 25 Jun 2013 14:23:06 +0000 (07:23 -0700)
committerbors <bors@rust-lang.org>
Tue, 25 Jun 2013 14:23:06 +0000 (07:23 -0700)
This adds a `#[no_drop_flag]` attribute. This attribute tells the compiler to omit the drop flag from the struct, if it has a destructor. When the destructor is run, instead of setting the drop flag, it instead zeroes-out the struct. This means the destructor can run multiple times and therefore it is up to the developer to use it safely.

The primary usage case for this is smart-pointer types like `Rc<T>` as the extra flag caused the struct to be 1 word larger because of alignment.

This closes #7271 and #7138

1  2 
src/librustc/middle/trans/glue.rs
src/librustc/middle/ty.rs

Simple merge
Simple merge