rust/tests/ui/structs-enums/class-dtor.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
367 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
// pretty-expanded FIXME #23616
2012-08-15 18:46:55 -07:00
struct cat {
done : extern "C" fn(usize),
meows : usize,
}
impl Drop for cat {
2013-09-16 21:18:07 -04:00
fn drop(&mut self) {
2012-12-01 15:25:17 -08:00
(self.done)(self.meows);
}
}
fn cat(done: extern "C" fn(usize)) -> cat {
2012-09-05 15:58:43 -07:00
cat {
meows: 0,
2012-09-05 15:58:43 -07:00
done: done
}
}
pub fn main() {}