rust - How to define and use macro in module? -
when i'm trying define macro in code, compiler says this:
refix/mod.rs:12:1: 12:12 error: macro definitions not stable enough use , subject change refix/mod.rs:12 macro_rules! re_fix( ^~~~~~~~~~~ refix/mod.rs:12:1: 12:12 note: add #[feature(macro_rules)] crate attributes enable refix/mod.rs:12 macro_rules! re_fix(
i've added lot of #[feature(macro_rules)]
, didn't help.
source code: https://gist.github.com/suhr/11207656
ps: yes, they're lot of other errors there, interested one.
i think error message misleading. have add #![feature(macro_rules)]
main crate module (note exclamation sign), along #![crate_id=...]
, others.
#![crate_id="rsfix#0.0"] #![feature(macro_rules)] macro_rules! example( ... ) fn main() { example!(...); }
this should work on latest compiler version.
Comments
Post a Comment