2018-11-24 15:34:13 +02:00
|
|
|
// force-host
|
2018-05-01 19:57:42 -04:00
|
|
|
// no-prefer-dynamic
|
|
|
|
|
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
|
|
|
|
|
|
|
use proc_macro::TokenStream;
|
|
|
|
|
|
|
|
#[proc_macro_derive(UnionTest)]
|
|
|
|
pub fn derive(input: TokenStream) -> TokenStream {
|
|
|
|
let input = input.to_string();
|
|
|
|
assert!(input.contains("#[repr(C)]"));
|
|
|
|
assert!(input.contains("union Test {"));
|
2020-06-14 14:30:42 +03:00
|
|
|
assert!(input.contains("a : u8,"));
|
2018-05-01 19:57:42 -04:00
|
|
|
assert!(input.contains("}"));
|
|
|
|
"".parse().unwrap()
|
|
|
|
}
|