From f108fce21cd025ead58ced8c21a8156fe339e26f Mon Sep 17 00:00:00 2001 From: Chris Wong Date: Sun, 8 Oct 2017 21:42:33 +1300 Subject: [PATCH] Make the result of `Literal::string()` more readable Closes #45076 --- src/libproc_macro/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index e6307f10c139f..cf30966fa8971 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -488,7 +488,7 @@ impl Literal { pub fn string(string: &str) -> Literal { let mut escaped = String::new(); for ch in string.chars() { - escaped.extend(ch.escape_unicode()); + escaped.extend(ch.escape_debug()); } Literal(token::Literal(token::Lit::Str_(Symbol::intern(&escaped)), None)) }