diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-09 13:01:35 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-09 13:01:35 +0100 |
commit | b43921cdddb4e703787ab87b0ea3f8eaff94f6c9 (patch) | |
tree | c562d58f6f25d8816643c5dbfd24a2cbae087e9c /crates/hir_expand/src/builtin_macro.rs | |
parent | 6c0cdc5f550c0ccef762fcff7d1fbee9b6245027 (diff) | |
parent | 01ce37c8052136b3a5ab1f703f774a1b293a25b7 (diff) |
Merge #8777
8777: Escape characters in builtin macros correctly r=edwin0cheng a=edwin0cheng
Fixes #8749
It is the same bug in #8560 but in our `quote!` macro.
Because the "\" are adding exponentially in #8749 case, so the text is eat up all the memory.
bors r+
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/hir_expand/src/builtin_macro.rs')
-rw-r--r-- | crates/hir_expand/src/builtin_macro.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_expand/src/builtin_macro.rs b/crates/hir_expand/src/builtin_macro.rs index 179de61f9..0142a06ed 100644 --- a/crates/hir_expand/src/builtin_macro.rs +++ b/crates/hir_expand/src/builtin_macro.rs | |||
@@ -788,9 +788,9 @@ mod tests { | |||
788 | r##" | 788 | r##" |
789 | #[rustc_builtin_macro] | 789 | #[rustc_builtin_macro] |
790 | macro_rules! concat {} | 790 | macro_rules! concat {} |
791 | concat!("foo", "r", 0, r#"bar"#, false); | 791 | concat!("foo", "r", 0, r#"bar"#, "\n", false); |
792 | "##, | 792 | "##, |
793 | expect![[r#""foor0barfalse""#]], | 793 | expect![[r#""foor0bar\nfalse""#]], |
794 | ); | 794 | ); |
795 | } | 795 | } |
796 | } | 796 | } |