summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hygiene/duplicate_lifetimes.rs
blob: 8971fb62626cbfb99a4a635b4a9eb06c5d684724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Ensure that lifetime parameter names are modernized before we check for
// duplicates.

#![feature(decl_macro, rustc_attrs)]

#[rustc_macro_transparency = "semitransparent"]
macro m($a:lifetime) {
    fn g<$a, 'a>() {} //~ ERROR the name `'a` is already used for a generic parameter
}

#[rustc_macro_transparency = "transparent"]
macro n($a:lifetime) {
    fn h<$a, 'a>() {} //~ ERROR the name `'a` is already used for a generic parameter
}

m!('a);
n!('a);

fn main() {}