]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hygiene/duplicate_lifetimes.rs
Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkov
[rust.git] / src / test / ui / hygiene / duplicate_lifetimes.rs
1 // Ensure that lifetime parameter names are modernized before we check for
2 // duplicates.
3
4 #![feature(decl_macro, rustc_attrs)]
5
6 #[rustc_macro_transparency = "semitransparent"]
7 macro m($a:lifetime) {
8     fn g<$a, 'a>() {} //~ ERROR lifetime name `'a` declared twice
9 }
10
11 #[rustc_macro_transparency = "transparent"]
12 macro n($a:lifetime) {
13     fn h<$a, 'a>() {} //~ ERROR lifetime name `'a` declared twice
14 }
15
16 m!('a);
17 n!('a);
18
19 fn main() {}