Skip to content

Commit 65a16c0

Browse files
committed
Auto merge of #49283 - varkor:combining-chars-escape_debug, r=SimonSapin
Escape combining characters in char::Debug Although combining characters are technically printable, they make little sense to print on their own with `Debug`: it'd be better to escape them like non-printable characters. This is a breaking change, but I imagine the fact `escape_debug` is rare and almost certainly primarily used for debugging that this is an acceptable change. Resolves #41922. r? @alexcrichton cc @clarcharr
2 parents cb20f68 + b653937 commit 65a16c0

File tree

7 files changed

+197
-33
lines changed

7 files changed

+197
-33
lines changed

.gitignore

+7-7
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ __pycache__/
7474
/obj/
7575
/rt/
7676
/rustllvm/
77-
/src/libstd_unicode/DerivedCoreProperties.txt
78-
/src/libstd_unicode/DerivedNormalizationProps.txt
79-
/src/libstd_unicode/PropList.txt
80-
/src/libstd_unicode/ReadMe.txt
81-
/src/libstd_unicode/Scripts.txt
82-
/src/libstd_unicode/SpecialCasing.txt
83-
/src/libstd_unicode/UnicodeData.txt
77+
/src/libcore/unicode/DerivedCoreProperties.txt
78+
/src/libcore/unicode/DerivedNormalizationProps.txt
79+
/src/libcore/unicode/PropList.txt
80+
/src/libcore/unicode/ReadMe.txt
81+
/src/libcore/unicode/Scripts.txt
82+
/src/libcore/unicode/SpecialCasing.txt
83+
/src/libcore/unicode/UnicodeData.txt
8484
/stage[0-9]+/
8585
/target
8686
target/

src/liballoc/str.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,21 @@ impl str {
372372

373373
/// Escapes each char in `s` with [`char::escape_debug`].
374374
///
375+
/// Note: only extended grapheme codepoints that begin the string will be
376+
/// escaped.
377+
///
375378
/// [`char::escape_debug`]: primitive.char.html#method.escape_debug
376379
#[unstable(feature = "str_escape",
377380
reason = "return type may change to be an iterator",
378381
issue = "27791")]
379382
pub fn escape_debug(&self) -> String {
380-
self.chars().flat_map(|c| c.escape_debug()).collect()
383+
let mut string = String::with_capacity(self.len());
384+
let mut chars = self.chars();
385+
if let Some(first) = chars.next() {
386+
string.extend(first.escape_debug_ext(true))
387+
}
388+
string.extend(chars.flat_map(|c| c.escape_debug_ext(false)));
389+
string
381390
}
382391

383392
/// Escapes each char in `s` with [`char::escape_default`].

src/liballoc/tests/str.rs

+7
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,12 @@ fn test_escape_unicode() {
989989

990990
#[test]
991991
fn test_escape_debug() {
992+
// Note that there are subtleties with the number of backslashes
993+
// on the left- and right-hand sides. In particular, Unicode code points
994+
// are usually escaped with two backslashes on the right-hand side, as
995+
// they are escaped. However, when the character is unescaped (e.g. for
996+
// printable characters), only a single backslash appears (as the character
997+
// itself appears in the debug string).
992998
assert_eq!("abc".escape_debug(), "abc");
993999
assert_eq!("a c".escape_debug(), "a c");
9941000
assert_eq!("éèê".escape_debug(), "éèê");
@@ -999,6 +1005,7 @@ fn test_escape_debug() {
9991005
assert_eq!("\u{10000}\u{10ffff}".escape_debug(), "\u{10000}\\u{10ffff}");
10001006
assert_eq!("ab\u{200b}".escape_debug(), "ab\\u{200b}");
10011007
assert_eq!("\u{10d4ea}\r".escape_debug(), "\\u{10d4ea}\\r");
1008+
assert_eq!("\u{301}a\u{301}\u{e000}".escape_debug(), "\\u{301}a\u{301}\\u{e000}");
10021009
}
10031010

10041011
#[test]

src/libcore/char/methods.rs

+31-9
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,27 @@ impl char {
187187
}
188188
}
189189

190+
/// An extended version of `escape_debug` that optionally permits escaping
191+
/// Extended Grapheme codepoints. This allows us to format characters like
192+
/// nonspacing marks better when they're at the start of a string.
193+
#[doc(hidden)]
194+
#[unstable(feature = "str_internals", issue = "0")]
195+
#[inline]
196+
pub fn escape_debug_ext(self, escape_grapheme_extended: bool) -> EscapeDebug {
197+
let init_state = match self {
198+
'\t' => EscapeDefaultState::Backslash('t'),
199+
'\r' => EscapeDefaultState::Backslash('r'),
200+
'\n' => EscapeDefaultState::Backslash('n'),
201+
'\\' | '\'' | '"' => EscapeDefaultState::Backslash(self),
202+
_ if escape_grapheme_extended && self.is_grapheme_extended() => {
203+
EscapeDefaultState::Unicode(self.escape_unicode())
204+
}
205+
_ if is_printable(self) => EscapeDefaultState::Char(self),
206+
_ => EscapeDefaultState::Unicode(self.escape_unicode()),
207+
};
208+
EscapeDebug(EscapeDefault { state: init_state })
209+
}
210+
190211
/// Returns an iterator that yields the literal escape code of a character
191212
/// as `char`s.
192213
///
@@ -224,15 +245,7 @@ impl char {
224245
#[stable(feature = "char_escape_debug", since = "1.20.0")]
225246
#[inline]
226247
pub fn escape_debug(self) -> EscapeDebug {
227-
let init_state = match self {
228-
'\t' => EscapeDefaultState::Backslash('t'),
229-
'\r' => EscapeDefaultState::Backslash('r'),
230-
'\n' => EscapeDefaultState::Backslash('n'),
231-
'\\' | '\'' | '"' => EscapeDefaultState::Backslash(self),
232-
c if is_printable(c) => EscapeDefaultState::Char(c),
233-
c => EscapeDefaultState::Unicode(c.escape_unicode()),
234-
};
235-
EscapeDebug(EscapeDefault { state: init_state })
248+
self.escape_debug_ext(true)
236249
}
237250

238251
/// Returns an iterator that yields the literal escape code of a character
@@ -692,6 +705,15 @@ impl char {
692705
general_category::Cc(self)
693706
}
694707

708+
/// Returns true if this `char` is an extended grapheme character, and false otherwise.
709+
///
710+
/// 'Extended grapheme character' is defined in terms of the Unicode Shaping and Rendering
711+
/// Category `Grapheme_Extend`.
712+
#[inline]
713+
pub(crate) fn is_grapheme_extended(self) -> bool {
714+
derived_property::Grapheme_Extend(self)
715+
}
716+
695717
/// Returns true if this `char` is numeric, and false otherwise.
696718
///
697719
/// 'Numeric'-ness is defined in terms of the Unicode General Categories

src/libcore/tests/char.rs

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ fn test_escape_debug() {
181181
assert_eq!(string('\u{ff}'), "\u{ff}");
182182
assert_eq!(string('\u{11b}'), "\u{11b}");
183183
assert_eq!(string('\u{1d4b6}'), "\u{1d4b6}");
184+
assert_eq!(string('\u{301}'), "\\u{301}"); // combining character
184185
assert_eq!(string('\u{200b}'),"\\u{200b}"); // zero width space
185186
assert_eq!(string('\u{e000}'), "\\u{e000}"); // private use 1
186187
assert_eq!(string('\u{100000}'), "\\u{100000}"); // private use 2

src/libcore/unicode/tables.rs

+122-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2018 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -549,6 +549,127 @@ pub mod derived_property {
549549
Cased_table.lookup(c)
550550
}
551551

552+
pub const Grapheme_Extend_table: &super::BoolTrie = &super::BoolTrie {
553+
r1: [
554+
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
555+
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
556+
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
557+
0xffffffffffffffff, 0x0000ffffffffffff, 0x0000000000000000, 0x0000000000000000,
558+
0x0000000000000000, 0x0000000000000000, 0x00000000000003f8, 0x0000000000000000,
559+
0x0000000000000000, 0x0000000000000000, 0xbffffffffffe0000, 0x00000000000000b6,
560+
0x0000000007ff0000, 0x00010000fffff800, 0x0000000000000000, 0x00003d9f9fc00000,
561+
0xffff000000020000, 0x00000000000007ff, 0x0001ffc000000000, 0x000ff80000000000
562+
],
563+
r2: [
564+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 7, 2, 20, 21,
565+
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 32, 2, 2, 2, 2, 2,
566+
2, 2, 2, 2, 2, 2, 2, 2, 2, 33, 34, 35, 36, 37, 2, 38, 2, 39, 2, 2, 2, 40, 41, 42, 2, 43,
567+
44, 45, 46, 47, 2, 2, 48, 2, 2, 2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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598+
2, 2, 2, 2, 71, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 72, 2, 2, 2, 2, 2, 58, 2
599+
],
600+
r3: &[
601+
0x00003eeffbc00000, 0x000000000e000000, 0x0000000000000000, 0xfffffffbfff00000,
602+
0x1400000000000007, 0x0000000c00fe21fe, 0x5000000000000002, 0x0000000c0080201e,
603+
0x1000000000000006, 0x0023000000023986, 0xfc00000c000021be, 0xd000000000000002,
604+
0x0000000c00c0201e, 0x4000000000000004, 0x0000000000802001, 0xc000000000000001,
605+
0x0000000c00603dc1, 0x9000000000000002, 0x0000000c00603044, 0x5800000000000003,
606+
0x00000000805c8400, 0x07f2000000000000, 0x0000000000007f80, 0x1bf2000000000000,
607+
0x0000000000003f00, 0x02a0000003000000, 0x7ffe000000000000, 0x1ffffffffeffe0df,
608+
0x0000000000000040, 0x66fde00000000000, 0x001e0001c3000000, 0x0000000020002064,
609+
0x00000000e0000000, 0x001c0000001c0000, 0x000c0000000c0000, 0x3fb0000000000000,
610+
0x00000000200ffe40, 0x0000000000003800, 0x0000020000000060, 0x0e04018700000000,
611+
0x0000000009800000, 0x9ff81fe57f400000, 0x7fff000000000000, 0x17d000000000000f,
612+
0x000ff80000000004, 0x00003b3c00000003, 0x0003a34000000000, 0x00cff00000000000,
613+
0x031021fdfff70000, 0xfbffffffffffffff, 0x0000000000001000, 0x0001ffffffff0000,
614+
0x0003800000000000, 0x8000000000000000, 0xffffffff00000000, 0x0000fc0000000000,
615+
0x0000000006000000, 0x3ff7800000000000, 0x00000000c0000000, 0x0003000000000000,
616+
0x0000006000000844, 0x0003ffff00000030, 0x00003fc000000000, 0x000000000003ff80,
617+
0x13c8000000000007, 0x0000002000000000, 0x00667e0000000000, 0x1000000000001008,
618+
0xc19d000000000000, 0x0040300000000002, 0x0000212000000000, 0x0000000040000000,
619+
0x0000ffff0000ffff
620+
],
621+
r4: [
622+
0, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 4, 2, 5, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626+
2, 2, 2, 2, 2, 2, 2, 2, 2, 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000100000000, 0x07c0000000000000,
654+
0x870000000000f06e, 0x0000006000000000, 0xff00000000000002, 0x800000000000007f,
655+
0x0678000000000003, 0x001fef8000000007, 0x0008000000000000, 0x7fc0000000000003,
656+
0x0000000000001c00, 0x40d3800000000000, 0x000007f880000000, 0x5000000000000003,
657+
0x001f1fc000800001, 0xff00000000000000, 0x000000000000005c, 0xa5f9000000000000,
658+
0x000000000000000d, 0xb03c800000000000, 0x0000000030000001, 0xa7f8000000000000,
659+
0x0000000000000001, 0x00bf280000000000, 0x00000fbce0000000, 0x79f800000000067e,
660+
0x000000000e7e0080, 0x00000000037ffc00, 0xbf7f000000000000, 0x006dfcfffffc0000,
661+
0xb47e000000000000, 0x00000000000000bf, 0x001f000000000000, 0x007f000000000000,
662+
0x0000000000078000, 0x0000000060000000, 0xf807c3a000000000, 0x00003c0000000fe7,
663+
0x000000000000001c, 0xf87fffffffffffff, 0x00201fffffffffff, 0x0000fffef8000010,
664+
0x000007dbf9ffff7f, 0x00000000007f0000, 0x00000000000007f0, 0xffffffff00000000,
665+
0xffffffffffffffff, 0x0000ffffffffffff
666+
],
667+
};
668+
669+
pub fn Grapheme_Extend(c: char) -> bool {
670+
Grapheme_Extend_table.lookup(c)
671+
}
672+
552673
pub const Lowercase_table: &super::BoolTrie = &super::BoolTrie {
553674
r1: [
554675
0x0000000000000000, 0x07fffffe00000000, 0x0420040000000000, 0xff7fffff80000000,

0 commit comments

Comments
 (0)