]>
Commit | Line | Data |
---|---|---|
2b03887a FG |
1 | // aux-build:attr-from-macro.rs |
2 | // run-pass | |
3 | ||
4 | extern crate attr_from_macro; | |
5 | ||
6 | attr_from_macro::creator! { | |
7 | struct Foo; | |
8 | enum Bar; | |
9 | enum FooBar; | |
10 | } | |
11 | ||
12 | fn main() { | |
13 | // Checking the `repr(u32)` on the enum. | |
14 | assert_eq!(4, std::mem::size_of::<Bar>()); | |
15 | // Checking the `repr(u16)` on the enum. | |
16 | assert_eq!(2, std::mem::size_of::<FooBar>()); | |
17 | ||
18 | // Checking the Debug impl on the types. | |
19 | eprintln!("{:?} {:?} {:?}", Foo, Bar::A, FooBar::A); | |
20 | } |