From 74a557857b95622abde85cdb20791a05c586db75 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Thu, 31 Dec 2020 17:59:29 +0800 Subject: Fix `==` in in format causes mismatched-arg-count --- crates/hir_expand/src/builtin_macro.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/hir_expand/src') diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs index 6382521fb..80b60d59f 100644 --- a/crates/hir_expand/src/builtin_macro.rs +++ b/crates/hir_expand/src/builtin_macro.rs @@ -259,7 +259,8 @@ fn format_args_expand( } for arg in &mut args { // Remove `key =`. - if matches!(arg.get(1), Some(tt::TokenTree::Leaf(tt::Leaf::Punct(p))) if p.char == '=') { + if matches!(arg.get(1), Some(tt::TokenTree::Leaf(tt::Leaf::Punct(p))) if p.char == '=' && p.spacing != tt::Spacing::Joint) + { arg.drain(..2); } } -- cgit v1.2.3