From 0a0e22235b7ad222be1aaa7765b580f4096c9aeb Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Sat, 20 Mar 2021 12:18:57 -0600 Subject: Make bare underscore token an Ident rather than Punct in proc-macro --- crates/mbe/src/tests/expand.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/mbe/src/tests/expand.rs') diff --git a/crates/mbe/src/tests/expand.rs b/crates/mbe/src/tests/expand.rs index 9dd8ff75b..2cce62781 100644 --- a/crates/mbe/src/tests/expand.rs +++ b/crates/mbe/src/tests/expand.rs @@ -1079,6 +1079,12 @@ macro_rules! q { .assert_expand_items(r#"q![_]"#, r#"0"#); } +#[test] +fn test_underscore_lifetime() { + parse_macro(r#"macro_rules! q { ($a:lifetime) => {0}; }"#) + .assert_expand_items(r#"q!['_]"#, r#"0"#); +} + #[test] fn test_vertical_bar_with_pat() { parse_macro( -- cgit v1.2.3