aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/hir_expand/src/builtin_macro.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs
index 2806842cd..57bc6fbd7 100644
--- a/crates/hir_expand/src/builtin_macro.rs
+++ b/crates/hir_expand/src/builtin_macro.rs
@@ -331,7 +331,9 @@ fn concat_expand(
331 text.push_str(&component); 331 text.push_str(&component);
332 } 332 }
333 // handle boolean literals 333 // handle boolean literals
334 tt::TokenTree::Leaf(tt::Leaf::Ident(id)) if i % 2 == 0 => { 334 tt::TokenTree::Leaf(tt::Leaf::Ident(id))
335 if i % 2 == 0 && (id.text == "true" || id.text == "false") =>
336 {
335 text.push_str(id.text.as_str()); 337 text.push_str(id.text.as_str());
336 } 338 }
337 tt::TokenTree::Leaf(tt::Leaf::Punct(punct)) if i % 2 == 1 && punct.char == ',' => (), 339 tt::TokenTree::Leaf(tt::Leaf::Punct(punct)) if i % 2 == 1 && punct.char == ',' => (),
@@ -739,7 +741,7 @@ mod tests {
739 r##" 741 r##"
740 #[rustc_builtin_macro] 742 #[rustc_builtin_macro]
741 macro_rules! concat {} 743 macro_rules! concat {}
742 concat!("foo", r, 0, r#"bar"#, false); 744 concat!("foo", "r", 0, r#"bar"#, false);
743 "##, 745 "##,
744 ); 746 );
745 747