2 releases
| 0.1.1 | Aug 5, 2023 |
|---|---|
| 0.1.0 | Jan 19, 2019 |
#597 in Procedural macros
42,389 downloads per month
Used in 141 crates
(13 directly)
8KB
Creates unique identifiers for macros using procedural macros and UUID
Examples
macro_rules! gen_fn {
($a:ty, $b:ty) => {
gensym::gensym!{ _gen_fn!{ $a, $b } }
};
}
macro_rules! _gen_fn {
($gensym:ident, $a:ty, $b:ty) => {
fn $gensym(a: $a, b: $b) {
unimplemented!()
}
};
}
mod test {
gen_fn!{ u64, u64 }
gen_fn!{ u64, u64 }
}
Generate a unique identifier with a span of Span::call_site and
insert it as the first argument to a macro call followed by a comma.
gensym
Creates unique identifiers for macros using procedural macros and UUID
Examples
macro_rules! gen_fn {
($a:ty, $b:ty) => {
gensym::gensym!{ _gen_fn!{ $a, $b } }
};
}
macro_rules! _gen_fn {
($gensym:ident, $a:ty, $b:ty) => {
fn $gensym(a: $a, b: $b) {
unimplemented!()
}
};
}
mod test {
gen_fn!{ u64, u64 }
gen_fn!{ u64, u64 }
}
Dependencies
~345–770KB
~17K SLoC