diff options
Diffstat (limited to 'tests/ui/hygiene/duplicate_lifetimes.rs')
-rw-r--r-- | tests/ui/hygiene/duplicate_lifetimes.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/hygiene/duplicate_lifetimes.rs b/tests/ui/hygiene/duplicate_lifetimes.rs new file mode 100644 index 000000000..8971fb626 --- /dev/null +++ b/tests/ui/hygiene/duplicate_lifetimes.rs @@ -0,0 +1,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() {} |