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/expander/matcher.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/mbe/src/expander') diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs index b6782b4ba..3c53960ce 100644 --- a/crates/mbe/src/expander/matcher.rs +++ b/crates/mbe/src/expander/matcher.rs @@ -710,6 +710,7 @@ fn match_meta_var(kind: &str, input: &mut TtIter) -> ExpandResult input .expect_ident() + .and_then(|ident| if ident.text == "_" { Err(()) } else { Ok(ident) }) .map(|ident| Some(tt::Leaf::from(ident.clone()).into())) .map_err(|()| err!("expected ident")), "tt" => input.expect_tt().map(Some).map_err(|()| err!()), -- cgit v1.2.3