diff options
author | Edwin Cheng <[email protected]> | 2020-12-31 09:59:29 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-12-31 09:59:29 +0000 |
commit | 74a557857b95622abde85cdb20791a05c586db75 (patch) | |
tree | 7560d13ac4d30da98ef1f96ae1608457cf751eba /crates/hir_expand/src | |
parent | a9814fa9c037b0fafd30580a6e7682ed032d77e6 (diff) |
Fix `==` in in format causes mismatched-arg-count
Diffstat (limited to 'crates/hir_expand/src')
-rw-r--r-- | crates/hir_expand/src/builtin_macro.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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( | |||
259 | } | 259 | } |
260 | for arg in &mut args { | 260 | for arg in &mut args { |
261 | // Remove `key =`. | 261 | // Remove `key =`. |
262 | if matches!(arg.get(1), Some(tt::TokenTree::Leaf(tt::Leaf::Punct(p))) if p.char == '=') { | 262 | if matches!(arg.get(1), Some(tt::TokenTree::Leaf(tt::Leaf::Punct(p))) if p.char == '=' && p.spacing != tt::Spacing::Joint) |
263 | { | ||
263 | arg.drain(..2); | 264 | arg.drain(..2); |
264 | } | 265 | } |
265 | } | 266 | } |