Closed
Description
This program:
use core::util::with;
use core::hashmap::linear::LinearMap;
fn main() {
let mut map = LinearMap::new();
map.insert(1, 1);
macro_rules! add_foo(
($a1:expr, $b1:expr) => ({
map.find(&$a1).map(|&m| *m + $b1);
})
);
macro_rules! foo(
($a:expr, $b:expr) => ({
add_foo!($a, $b);
add_foo!($b, $a);
})
);
let def = 1;
foo!(def, def);
}
fail with:
$ rustc --test bug2.rs
bug2.rs:22:12: 22:15 error: internal compiler error: No variable registered for id 25
bug2.rs:22 foo!(def, def);
^~~
bug2.rs:8:2: 12:4 note: in expansion of add_foo!
bug2.rs:16:6: 16:23 note: expansion site
bug2.rs:14:2: 19:4 note: in expansion of foo!
bug2.rs:22:2: 22:17 note: expansion site