Last active
July 10, 2016 04:26
-
-
Save orthecreedence/599897d7ae38b6b271ac077239c00ab9 to your computer and use it in GitHub Desktop.
Rust macro error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro_rules! serializable { | |
( | |
$(#[$struct_meta:meta])* | |
pub struct $name:ident { | |
$( | |
$(#[$field_meta:meta]) * | |
$field:ident: $type_:ty | |
),* , | |
} | |
) => { | |
$(#[$struct_meta])* | |
pub struct $name { | |
$( | |
$(#[$field_meta]) * | |
$field: $type_ | |
),* , | |
} | |
} | |
} | |
serializable! { | |
#[allow(dead_code)] | |
/// This is a test | |
pub struct Tester { | |
#[allow(dead_code)] | |
name: String, | |
} | |
} |
removing the #[allow(dead_code)]
above name: String
works
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gives the error: