rust/library/std/src
Matthias Krüger 3148a322d8
Rollup merge of #92124 - AngelicosPhosphoros:remove_extra_alloc_in_cstring_new_35838, r=Mark-Simulacrum
Little improves in CString `new` when creating from slice

Old code already contain optimization for cases with `&str` and `&[u8]` args. This commit adds a specialization for `&mut[u8]` too.

Also, I added usage of old slice in search for zero bytes instead of new buffer because it produce better code for constant inputs on Windows LTO builds. For other platforms, this wouldn't cause any difference because it calls `libc` anyway.

Inlined `_new` method into spec trait to reduce amount of code generated to `CString::new` callers.
2022-01-19 10:42:15 +01:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error silence tidy errors 2022-01-07 13:59:27 -08:00
f32 Implement IEEE 754-2019 minimun and maximum functions for f32/f64 2021-11-20 10:14:03 +01:00
f64 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
ffi Rollup merge of #92124 - AngelicosPhosphoros:remove_extra_alloc_in_cstring_new_35838, r=Mark-Simulacrum 2022-01-19 10:42:15 +01:00
fs Update stdlib to the 2021 edition 2021-12-18 00:21:53 +11:00
io Remove &mut from io::read_to_string signature 2022-01-13 10:57:45 -08:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net fix stability attribute for tcp::IntoIncoming 2022-01-13 16:04:02 -05:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Rollup merge of #92775 - xfix:osstringext-inline, r=m-ou-se 2022-01-15 11:28:23 +01:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path add benchmarks and tests for Hash and Eq impls on Path 2021-11-09 20:54:00 +01:00
prelude Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
process Rollup merge of #92208 - ChrisDenton:win-bat-cmd, r=dtolnay 2021-12-23 00:28:56 +01:00
sync Make Receiver::into_iter into a clickable link 2022-01-03 20:17:57 +03:00
sys Rollup merge of #92517 - ChrisDenton:explicit-path, r=dtolnay 2022-01-05 11:26:07 +01:00
sys_common Auto merge of #92396 - xfix:remove-commandenv-apply, r=Mark-Simulacrum 2022-01-01 20:45:37 +00:00
thread Rollup merge of #92619 - Alexendoo:macro-diagnostic-items, r=matthewjasper 2022-01-16 16:58:14 +01:00
time Add #[must_use] to remaining std functions (O-Z) 2021-10-30 23:37:32 -04:00
alloc.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Change Backtrace::enabled atomic from SeqCst to Relaxed 2021-12-20 12:34:10 -08:00
env.rs Rollup merge of #89999 - talagrand:GetTempPath2, r=m-ou-se 2021-12-09 05:08:31 +01:00
error.rs Rollup merge of #91938 - yaahc:error-reporter, r=m-ou-se 2022-01-13 08:11:18 +01:00
f32.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
f64.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
fs.rs Typos fix 2022-01-14 00:17:11 +03:00
keyword_docs.rs eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
lazy.rs Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
lib.rs Rollup merge of #93016 - Amanieu:vec_spare_capacity, r=Mark-Simulacrum 2022-01-18 04:42:11 +01:00
macros.rs Add diagnostic items for macros 2022-01-06 14:59:33 +00:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Implement panic::update_hook 2022-01-07 17:28:20 +01:00
panicking.rs Add safety comments to panic::(set/take/update)_hook 2022-01-08 00:57:59 +01:00
path.rs Typos fix 2022-01-14 00:17:11 +03:00
primitive_docs.rs Update docs. 2021-12-04 19:40:33 +01:00
process.rs Update stdlib to the 2021 edition 2021-12-18 00:21:53 +11:00
rt.rs Rollup merge of #89068 - bjorn3:restructure_rt2, r=joshtriplett 2021-10-31 13:20:04 +01:00
time.rs Fix doc formatting for time.rs 2022-01-10 14:22:45 +03:00