rust/src/libcore
bors d1df3fecdf Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichton
Escape fewer Unicode codepoints in `Debug` impl of `str`

Use the same procedure as Python to determine whether a character is
printable, described in [PEP 3138]. In particular, this means that the
following character classes are escaped:

- Cc (Other, Control)
- Cf (Other, Format)
- Cs (Other, Surrogate), even though they can't appear in Rust strings
- Co (Other, Private Use)
- Cn (Other, Not Assigned)
- Zl (Separator, Line)
- Zp (Separator, Paragraph)
- Zs (Separator, Space), except for the ASCII space `' '` `0x20`

This allows for user-friendly inspection of strings that are not
English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`).

Fixes #34318.
CC #34422.

[PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-28 11:20:33 -07:00
..
fmt Rename char::escape to char::escape_debug and add tracking issue 2016-07-28 02:20:49 +02:00
hash Add BuildHasher example 2016-07-22 16:38:16 +02:00
iter Rollup merge of #34732 - durka:patch-27, r=steveklabnik 2016-07-26 17:21:11 -04:00
num Improve float number example 2016-07-15 17:51:27 +02:00
prelude Add missing annotations and some tests 2015-11-18 01:24:21 +03:00
str Auto merge of #34425 - tbu-:pr_len_instead_of_size_hint, r=alexcrichton 2016-06-24 09:03:54 -07:00
sync atomic doc: fix statement 2016-06-02 19:36:10 +02:00
any.rs Improve std::any module doc 2016-07-10 19:41:50 +02:00
array.rs Fix broken links for core primitives 2016-03-01 20:44:48 +08:00
borrow.rs Move the Borrow and BorrowMut traits to libcore. 2015-08-22 13:58:39 +02:00
Cargo.toml No build.rs for libcore 2016-06-04 15:10:26 -07:00
cell.rs Add missing examples for std::cell types 2016-07-11 17:13:36 +02:00
char.rs Rename char::escape to char::escape_debug and add tracking issue 2016-07-28 02:20:49 +02:00
char_private.rs Escape fewer Unicode codepoints in Debug impl of str 2016-07-23 00:18:44 +02:00
clone.rs Prefer ClassName over Self in example trait implementations 2016-05-23 13:14:15 -04:00
cmp.rs Complete PartialOrd's example so it passes make check-docs 2016-05-23 14:39:41 -04:00
convert.rs Implement RFC 1542 2016-05-07 08:52:41 -07:00
default.rs Move all Default docs from module to trait 2016-05-23 13:47:28 -04:00
intrinsics.rs Rollup merge of #34609 - ubsan:transmute_docs, r=steveklabnik 2016-07-26 17:21:11 -04:00
iter_private.rs specialize zip: Introduce TrustedRandomAccess trait 2016-06-14 15:50:49 +02:00
lib.rs Fix indentation in src/libcore/lib.rs 2016-07-23 00:18:44 +02:00
macros.rs doc: Mention that writeln! and println! always use LF 2016-07-12 14:39:16 +09:00
marker.rs Reorder Copy doc sections 2016-05-23 10:03:44 -04:00
mem.rs Support 16-bit pointers as well as i/usize 2016-05-19 13:55:13 -04:00
nonzero.rs Register new snapshots 2015-12-21 09:26:21 -08:00
ops.rs Stabilize FnOnce::Output + Fix rebase 2016-07-08 13:35:17 +03:00
option.rs core: impl From<T> for Option<T> 2016-07-20 15:54:54 -07:00
panicking.rs Mark all extern functions as nounwind 2015-09-14 11:36:09 +02:00
ptr.rs Implement traits for variadic function pointers 2016-07-17 10:21:07 +03:00
raw.rs std: Clean out old unstable + deprecated APIs 2016-05-30 20:46:32 -07:00
result.rs Improve code example for try! 2016-06-29 01:13:03 +02:00
slice.rs Indicate where std::slice structs originate from. 2016-07-17 09:16:47 -04:00
tuple.rs Properly document tuples 2016-02-09 16:00:50 -05:00