summary refs log tree commit diff
path: root/src/test/run-pass/structs-enums/class-attributes-2.rs
blob: d6cf63e62fea2d6da5b93a5d4d864d12e352086a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// run-pass
#![allow(unused_attributes)]
#![allow(non_camel_case_types)]

#![feature(custom_attribute)]

struct cat {
  name: String,
}

impl Drop for cat {
    #[cat_dropper]
    /**
       Actually, cats don't always land on their feet when you drop them.
    */
    fn drop(&mut self) {
        println!("{} landed on hir feet", self.name);
    }
}

#[cat_maker]
/**
Maybe it should technically be a kitten_maker.
*/
fn cat(name: String) -> cat {
    cat {
        name: name
    }
}

pub fn main() {
  let _kitty = cat("Spotty".to_string());
}