rust/library
bors a426fc37f2 Auto merge of #85391 - Mark-Simulacrum:opt-tostring, r=scottmcm
Avoid zero-length memcpy in formatting

This has two separate and somewhat orthogonal commits. The first change adjusts the ToString general impl for all types that implement Display; it no longer uses the full format machinery, rather directly falling onto a `std::fmt::Display::fmt` call. The second change directly adjusts the general core::fmt::write function which handles the production of format_args! to avoid zero-length push_str calls.

Both changes target the fact that push_str will still call memmove internally (or a similar function), as it doesn't know the length of the passed string. For zero-length strings in particular, this is quite expensive, and even for very short (several bytes long) strings, this is also expensive. Future work in this area may wish to have us fallback to write_char or similar, which may be cheaper on the (typically) short strings between the interpolated pieces in format_args!.
2021-05-20 00:55:27 +00:00
..
alloc Auto merge of #85391 - Mark-Simulacrum:opt-tostring, r=scottmcm 2021-05-20 00:55:27 +00:00
backtrace@221483ebaf Update backtrace to 0.3.57 2021-04-25 13:48:03 -07:00
core Auto merge of #85391 - Mark-Simulacrum:opt-tostring, r=scottmcm 2021-05-20 00:55:27 +00:00
panic_abort android: set abort message 2021-04-09 15:33:43 +02:00
panic_unwind Change 'NULL' to 'null' 2021-05-02 17:46:00 -06:00
proc_macro Implement span quoting for proc-macros 2021-05-12 00:51:31 -04:00
profiler_builtins update cc crate 2021-05-12 00:55:03 +02:00
rtstartup Bump bootstrap compiler to 1.50 beta 2020-12-30 09:27:19 -05:00
rustc-std-workspace-alloc mv std libs to library/ 2020-07-27 19:51:13 -05:00
rustc-std-workspace-core Fix rustc-std-workspace-core documentation 2020-12-20 15:23:21 +08:00
rustc-std-workspace-std mv std libs to library/ 2020-07-27 19:51:13 -05:00
std Auto merge of #84876 - alexcrichton:inline-thread-locals-cross-crate, r=Mark-Simulacrum 2021-05-19 15:59:46 +00:00
stdarch@c14e98417f update stdarch 2021-05-13 15:01:09 +02:00
term Allow/fix non_fmt_panic in tests. 2021-02-03 23:15:45 +01:00
test move core::hint::black_box under its own feature gate 2021-04-25 11:08:12 +02:00
unwind update cc crate 2021-05-12 00:55:03 +02:00