aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/expander
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mbe/src/expander')
-rw-r--r--crates/mbe/src/expander/matcher.rs8
-rw-r--r--crates/mbe/src/expander/transcriber.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs
index b4f2fe9a4..0d694b1a7 100644
--- a/crates/mbe/src/expander/matcher.rs
+++ b/crates/mbe/src/expander/matcher.rs
@@ -645,7 +645,7 @@ fn match_loop(pattern: &MetaTemplate, src: &tt::Subtree) -> Match {
645 None if match_res.err.is_none() => { 645 None if match_res.err.is_none() => {
646 bindings_builder.push_optional(&mut item.bindings, name); 646 bindings_builder.push_optional(&mut item.bindings, name);
647 } 647 }
648 _ => {} 648 None => {}
649 } 649 }
650 if let Some(err) = match_res.err { 650 if let Some(err) = match_res.err {
651 res.add_err(err); 651 res.add_err(err);
@@ -756,7 +756,7 @@ impl<'a> TtIter<'a> {
756 let ok = match separator { 756 let ok = match separator {
757 Separator::Ident(lhs) if idx == 0 => match fork.expect_ident_or_underscore() { 757 Separator::Ident(lhs) if idx == 0 => match fork.expect_ident_or_underscore() {
758 Ok(rhs) => rhs.text == lhs.text, 758 Ok(rhs) => rhs.text == lhs.text,
759 _ => false, 759 Err(_) => false,
760 }, 760 },
761 Separator::Literal(lhs) if idx == 0 => match fork.expect_literal() { 761 Separator::Literal(lhs) if idx == 0 => match fork.expect_literal() {
762 Ok(rhs) => match rhs { 762 Ok(rhs) => match rhs {
@@ -764,11 +764,11 @@ impl<'a> TtIter<'a> {
764 tt::Leaf::Ident(rhs) => rhs.text == lhs.text, 764 tt::Leaf::Ident(rhs) => rhs.text == lhs.text,
765 tt::Leaf::Punct(_) => false, 765 tt::Leaf::Punct(_) => false,
766 }, 766 },
767 _ => false, 767 Err(_) => false,
768 }, 768 },
769 Separator::Puncts(lhss) if idx < lhss.len() => match fork.expect_punct() { 769 Separator::Puncts(lhss) if idx < lhss.len() => match fork.expect_punct() {
770 Ok(rhs) => rhs.char == lhss[idx].char, 770 Ok(rhs) => rhs.char == lhss[idx].char,
771 _ => false, 771 Err(_) => false,
772 }, 772 },
773 _ => false, 773 _ => false,
774 }; 774 };
diff --git a/crates/mbe/src/expander/transcriber.rs b/crates/mbe/src/expander/transcriber.rs
index 49a137577..4894e2a0c 100644
--- a/crates/mbe/src/expander/transcriber.rs
+++ b/crates/mbe/src/expander/transcriber.rs
@@ -241,6 +241,6 @@ fn push_fragment(buf: &mut Vec<tt::TokenTree>, fragment: Fragment) {
241fn push_subtree(buf: &mut Vec<tt::TokenTree>, tt: tt::Subtree) { 241fn push_subtree(buf: &mut Vec<tt::TokenTree>, tt: tt::Subtree) {
242 match tt.delimiter { 242 match tt.delimiter {
243 None => buf.extend(tt.token_trees), 243 None => buf.extend(tt.token_trees),
244 _ => buf.push(tt.into()), 244 Some(_) => buf.push(tt.into()),
245 } 245 }
246} 246}