rust/src/test/run-pass/class-attributes-1.rs

17 lines
304 B
Rust
Raw Normal View History

// pp-exact - Make sure we actually print the attributes
2012-08-16 16:26:10 -05:00
struct cat {
name: ~str,
}
impl cat: Drop {
#[cat_dropper]
fn finalize(&self) { error!("%s landed on hir feet",self.name); }
}
2012-09-05 17:58:43 -05:00
#[cat_maker]
fn cat(name: ~str) -> cat { cat{name: name,} }
fn main() { let _kitty = cat(~"Spotty"); }