diff --git a/src/libcore/io.rs b/src/libcore/io.rs index ffe4379b5bc..4b828dd4bc7 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -1108,10 +1108,13 @@ pub mod fsync { // Artifacts that need to fsync on destruction pub struct Res { arg: Arg, - drop { + } + + impl Res: Drop { + fn finalize(&self) { match self.arg.opt_level { - option::None => (), - option::Some(level) => { + None => (), + Some(level) => { // fail hard if not succesful assert((self.arg.fsync_fn)(self.arg.val, level) != -1); }