]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #46798 - Diggsey:debug-osstr, r=dtolnay
authorbors <bors@rust-lang.org>
Mon, 18 Dec 2017 02:54:11 +0000 (02:54 +0000)
committerbors <bors@rust-lang.org>
Mon, 18 Dec 2017 02:54:11 +0000 (02:54 +0000)
Add lossless debug implementation for unix OsStrs

Fixes #22766

Invalid utf8 byte sequences are replaced with `\xFF` style escape codes, while valid utf8 goes through the normal `Debug` implementation.

This is necessarily different from the windows Debug implementation, which uses `\u{xxxx}` style escape sequences for unpaired surrogates, but both implementations are consistent in that they are both lossless, and display invalid sequences in the way most similar to existing language syntax.

r? @dtolnay


Trivial merge