aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/expander
diff options
context:
space:
mode:
authorKevin Mehall <[email protected]>2021-03-20 18:18:57 +0000
committerKevin Mehall <[email protected]>2021-03-20 18:28:44 +0000
commit0a0e22235b7ad222be1aaa7765b580f4096c9aeb (patch)
tree1742dd3512904541543f1b7a929cbc77cad14402 /crates/mbe/src/expander
parent5cc8ad0c4afda0c8b6222156b0c725cfb61892c0 (diff)
Make bare underscore token an Ident rather than Punct in proc-macro
Diffstat (limited to 'crates/mbe/src/expander')
-rw-r--r--crates/mbe/src/expander/matcher.rs1
1 files changed, 1 insertions, 0 deletions
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<Option<Fragmen
710 let tt_result = match kind { 710 let tt_result = match kind {
711 "ident" => input 711 "ident" => input
712 .expect_ident() 712 .expect_ident()
713 .and_then(|ident| if ident.text == "_" { Err(()) } else { Ok(ident) })
713 .map(|ident| Some(tt::Leaf::from(ident.clone()).into())) 714 .map(|ident| Some(tt::Leaf::from(ident.clone()).into()))
714 .map_err(|()| err!("expected ident")), 715 .map_err(|()| err!("expected ident")),
715 "tt" => input.expect_tt().map(Some).map_err(|()| err!()), 716 "tt" => input.expect_tt().map(Some).map_err(|()| err!()),