]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-41803.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-41803.rs
CommitLineData
b7449926 1// run-pass
cc61c64b
XL
2/// A compile-time map from identifiers to arbitrary (heterogeneous) expressions
3macro_rules! ident_map {
4 ( $name:ident = { $($key:ident => $e:expr,)* } ) => {
5 macro_rules! $name {
6 $(
7 ( $key ) => { $e };
8 )*
9 // Empty invocation expands to nothing. Needed when the map is empty.
10 () => {};
11 }
12 };
13}
14
15ident_map!(my_map = {
16 main => 0,
17});
18
7453a54e 19fn main() {
cc61c64b 20 my_map!(main);
223e47cc 21}