rust/src/libstd/sys_common
bors 528307ab1c Auto merge of #43830 - alexcrichton:path-display-regression, r=aturon
std: Respect formatting flags for str-like OsStr

Historically many `Display` and `Debug` implementations for `OsStr`-like
abstractions have gone through `String::from_utf8_lossy`, but this was updated
in #42613 to use an internal `Utf8Lossy` abstraction instead. This had the
unfortunate side effect of causing a regression (#43765) in code which relied on
these `fmt` trait implementations respecting the various formatting flags
specified.

This commit opportunistically adds back interpretation of formatting trait flags
in the "common case" where where `OsStr`-like "thing" is all valid utf-8 and can
delegate to the formatting implementation for `str`. This doesn't entirely solve
the regression as non-utf8 paths will format differently than they did before
still (in that they will not respect formatting flags), but this should solve
the regression for all "real world" use cases of paths and such. The door's also
still open for handling these flags in the future!

Closes #43765
2017-08-23 03:24:13 +00:00
..
gnu travis: Fuchsia builder 2017-03-10 08:28:40 -08:00
at_exit_imp.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
backtrace.rs Don't show the std frames before user code on unwinding. 2017-05-09 19:51:50 +02:00
condvar.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
io.rs Add Read::initializer. 2017-06-20 20:26:22 -07:00
memchr.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
mod.rs Fix backtrace on Redox 2017-07-13 20:07:37 -06:00
mutex.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
net.rs addrinfo hint in lookup_host() needs clean initialization on all platforms 2017-08-07 09:07:26 -07:00
poison.rs Adding links around Sender/SyncSender/Receiver errors; Adding more documentation to channel() and sync_channel(); adding more links #29377 2017-04-08 15:33:21 -04:00
remutex.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
rwlock.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
thread.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
thread_info.rs use field init shorthand EVERYWHERE 2017-08-15 15:29:17 -07:00
thread_local.rs use field init shorthand EVERYWHERE 2017-08-15 15:29:17 -07:00
util.rs std: Move sys_common to libstd/sys_common 2016-11-01 17:08:24 +00:00
wtf8.rs std: Respect formatting flags for str-like OsStr 2017-08-13 21:07:03 -07:00