From 75a26f64ff8aa4fcacd849b2b3cde8f688baa789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 18 Dec 2020 17:47:48 +0200 Subject: mbe: treat _ as ident --- crates/mbe/src/tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crates/mbe/src/tests.rs') diff --git a/crates/mbe/src/tests.rs b/crates/mbe/src/tests.rs index dff6e98c2..f10e7a9b6 100644 --- a/crates/mbe/src/tests.rs +++ b/crates/mbe/src/tests.rs @@ -991,6 +991,18 @@ fn test_tt_composite2() { ); } +#[test] +fn test_underscore() { + parse_macro( + r#" + macro_rules! foo { + ($_:tt) => { 0 } + } + "#, + ) + .assert_expand_items(r#"foo! { => }"#, r#"0"#); +} + #[test] fn test_lifetime() { parse_macro( -- cgit v1.2.3