]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/class-attributes-2.rs
Get "make check" to work with unused-attribute
[rust.git] / src / test / run-pass / class-attributes-2.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10 #![allow(unused_attribute)]
11
12 struct cat {
13   name: StrBuf,
14 }
15
16 impl Drop for cat {
17     #[cat_dropper]
18     /**
19        Actually, cats don't always land on their feet when you drop them.
20     */
21     fn drop(&mut self) {
22         println!("{} landed on hir feet", self.name);
23     }
24 }
25
26 #[cat_maker]
27 /**
28 Maybe it should technically be a kitten_maker.
29 */
30 fn cat(name: StrBuf) -> cat {
31     cat {
32         name: name
33     }
34 }
35
36 pub fn main() {
37   let _kitty = cat("Spotty".to_strbuf());
38 }