aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/builtin_macro.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src/builtin_macro.rs')
-rw-r--r--crates/hir_expand/src/builtin_macro.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index dddbbcdac..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 }
@@ -563,6 +564,7 @@ mod tests {
563 564
564 let args = macro_call.token_tree().unwrap(); 565 let args = macro_call.token_tree().unwrap();
565 let parsed_args = mbe::ast_to_token_tree(&args).unwrap().0; 566 let parsed_args = mbe::ast_to_token_tree(&args).unwrap().0;
567 let call_id = AstId::new(file_id.into(), ast_id_map.ast_id(&macro_call));
566 568
567 let arg_id = db.intern_eager_expansion({ 569 let arg_id = db.intern_eager_expansion({
568 EagerCallLoc { 570 EagerCallLoc {
@@ -570,7 +572,7 @@ mod tests {
570 fragment: FragmentKind::Expr, 572 fragment: FragmentKind::Expr,
571 subtree: Arc::new(parsed_args.clone()), 573 subtree: Arc::new(parsed_args.clone()),
572 krate, 574 krate,
573 file_id: file_id.into(), 575 call: call_id,
574 } 576 }
575 }); 577 });
576 578
@@ -580,7 +582,7 @@ mod tests {
580 fragment, 582 fragment,
581 subtree: Arc::new(subtree), 583 subtree: Arc::new(subtree),
582 krate, 584 krate,
583 file_id: file_id.into(), 585 call: call_id,
584 }; 586 };
585 587
586 let id: MacroCallId = db.intern_eager_expansion(eager).into(); 588 let id: MacroCallId = db.intern_eager_expansion(eager).into();