diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/hir_expand/src/builtin_macro.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs index f60666a54..477192a09 100644 --- a/crates/hir_expand/src/builtin_macro.rs +++ b/crates/hir_expand/src/builtin_macro.rs | |||
@@ -245,6 +245,12 @@ fn format_args_expand( | |||
245 | if args.is_empty() { | 245 | if args.is_empty() { |
246 | return ExpandResult::only_err(mbe::ExpandError::NoMatchingRule); | 246 | return ExpandResult::only_err(mbe::ExpandError::NoMatchingRule); |
247 | } | 247 | } |
248 | for arg in &mut args { | ||
249 | // Remove `key =`. | ||
250 | if matches!(arg.get(1), Some(tt::TokenTree::Leaf(tt::Leaf::Punct(p))) if p.char == '=') { | ||
251 | arg.drain(..2); | ||
252 | } | ||
253 | } | ||
248 | let _format_string = args.remove(0); | 254 | let _format_string = args.remove(0); |
249 | let arg_tts = args.into_iter().flat_map(|arg| { | 255 | let arg_tts = args.into_iter().flat_map(|arg| { |
250 | quote! { std::fmt::ArgumentV1::new(&(##arg), std::fmt::Display::fmt), } | 256 | quote! { std::fmt::ArgumentV1::new(&(##arg), std::fmt::Display::fmt), } |