about summary refs log tree commit diff
path: root/tests/ui/macros/for-loop-macro-rules-hygiene.rs
blob: fcebda1b9da82774d35828a34bb73431262cf70f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//! Regression test for https://github.com/rust-lang/rust/issues/15189

//@ run-pass
macro_rules! third {
    ($e:expr) => ({let x = 2; $e[x]})
}

fn main() {
    let x = vec![10_usize,11_usize,12_usize,13_usize];
    let t = third!(x);
    assert_eq!(t,12_usize);
}