// except according to those terms.
// error-pattern:drop 1
-use std::io::{self, Write};
/// Structure which will not allow to be dropped twice.
impl<'a> Drop for Droppable<'a> {
fn drop(&mut self) {
if *self.0 {
- writeln!(io::stderr(), "{} dropped twice", self.1);
+ eprintln!("{} dropped twice", self.1);
::std::process::exit(1);
}
- writeln!(io::stderr(), "drop {}", self.1);
+ eprintln!("drop {}", self.1);
*self.0 = true;
}
}