diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-20 18:18:57 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-21 17:31:34 -0700 |
| commit | d4fee24c7c4c8ddb1c2c681a01f666a59881acbb (patch) | |
| tree | 8e708c38984e6d54dfe823377113d6047d9f3551 /src/libstd/c_vec.rs | |
| parent | 5726fd45268d1ef3574c9321c7ce6efb7e676eac (diff) | |
| download | rust-d4fee24c7c4c8ddb1c2c681a01f666a59881acbb.tar.gz rust-d4fee24c7c4c8ddb1c2c681a01f666a59881acbb.zip | |
librustc: Forbid destructors from being attached to any structs that might contain non-Owned fields. r=nmatsakis
Diffstat (limited to 'src/libstd/c_vec.rs')
| -rw-r--r-- | src/libstd/c_vec.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libstd/c_vec.rs b/src/libstd/c_vec.rs index 8e75f694fa3..d9595656f05 100644 --- a/src/libstd/c_vec.rs +++ b/src/libstd/c_vec.rs @@ -54,11 +54,14 @@ struct DtorRes { dtor: Option<@fn()>, } +#[unsafe_destructor] impl Drop for DtorRes { fn finalize(&self) { - match self.dtor { - option::None => (), - option::Some(f) => f() + unsafe { + match self.dtor { + option::None => (), + option::Some(f) => f() + } } } } |
