rust/library/std/src
Matthias Krüger 1484742f4a
Rollup merge of #101011 - BlackHoleFox:apple-random-improvements, r=thomcc
Use getentropy when possible on all Apple platforms

As the current code comments say, `SecRandomCopyBytes` is very heavyweight (regardless of purpose) compared to just asking the kernel directly for bytes from its own CSPRNG. We were not previously making an attempt to use the more efficient `getentropy` call on other Apple targets, instead solely using it on macOS. As the function is available on newer versions of Apple's different OSes, this changes the random filling to always attempt it first everywhere, only falling back to the less ideal alternatives after. This also cleans up the multiple Apple `imp` blocks into one.

It also should give a perf improvement, even if its likely unnoticeably small.

Refed XCode header for `getentropy` in the SDK:
```h
int getentropy(void* buffer, size_t size) __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0);
```

r? ``@thomcc``
2022-08-31 07:57:56 +02:00
..
backtrace Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
collections Move error trait into core 2022-08-22 13:28:25 -07:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error remove fn backtrace 2022-08-01 20:10:40 +00:00
f32 Semicolon after macro_rules definition. 2022-08-15 12:33:00 +02:00
f64 Semicolon after macro_rules definition. 2022-08-15 12:33:00 +02:00
ffi Guarantee try_reserve preserves the contents on error 2022-08-10 01:51:38 +09:00
fs Ignore hiberfil_sys test in CI 2022-07-18 15:06:07 +01:00
io Rollup merge of #100819 - WaffleLapkin:use_ptr_byte_methods, r=scottmcm 2022-08-29 16:49:43 +05:30
net Rollup merge of #94890 - marmeladema:ip-addr-try-from-bytes, r=joshtriplett 2022-08-29 06:34:41 +02:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Rollup merge of #96334 - devnexen:socket_mark, r=dtolnay 2022-08-29 06:34:42 +02:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path make many std tests work in Miri 2022-08-18 18:07:39 -04:00
personality Move personality functions to std 2022-08-23 16:12:58 +08:00
prelude Finish bumping stage0 2022-05-27 07:36:17 -04:00
process Add test for issue #95178 2022-03-23 05:33:44 +00:00
sync make many std tests work in Miri 2022-08-18 18:07:39 -04:00
sys Rollup merge of #101011 - BlackHoleFox:apple-random-improvements, r=thomcc 2022-08-31 07:57:56 +02:00
sys_common Auto merge of #100201 - RalfJung:thread-local-key, r=thomcc 2022-08-28 15:12:31 +00:00
thread update and extend some comments, and cfg-out some unused code 2022-08-22 09:14:33 -04:00
time make many std tests work in Miri 2022-08-18 18:07:39 -04:00
alloc.rs Update std::alloc::System docs 2022-06-26 16:31:29 +02:00
ascii.rs Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
backtrace.rs Adjust backtrace stabilization version to CURRENT_RUSTC_VERSION 2022-08-27 17:08:53 +02:00
env.rs add aliases for current_dir 2022-05-24 19:41:40 -07:00
error.rs error::Error: remove some comments 2022-08-25 07:42:07 +01:00
f32.rs Improve primitive/std docs separation and headers 2022-08-20 16:50:29 -05:00
f64.rs Improve primitive/std docs separation and headers 2022-08-20 16:50:29 -05:00
fs.rs Rollup merge of #98801 - joshtriplett:file-create-new, r=thomcc 2022-08-29 16:49:38 +05:30
keyword_docs.rs Rollup merge of #98169 - pierwill:dyn-disp, r=JohnTitor 2022-06-17 07:16:58 +09:00
lazy.rs Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock 2022-06-16 19:54:42 +04:00
lib.rs Auto merge of #100812 - Nilstrieb:revert-let-chains-nightly, r=Mark-Simulacrum 2022-08-30 05:48:22 +00:00
macros.rs Rollup merge of #99742 - sigaloid:master, r=thomcc 2022-08-26 14:08:44 +02:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Support unstable moves via stable in unstable items 2022-07-08 21:18:13 +00:00
panicking.rs Auto merge of #92461 - rust-lang:const_tls_local_panic_count, r=Mark-Simulacrum 2022-05-23 13:04:59 +00:00
path.rs Rollup merge of #97912 - Kixunil:stabilize_path_try_exists, r=dtolnay 2022-06-20 07:37:41 +09:00
personality.rs Move personality functions to std 2022-08-23 16:12:58 +08:00
primitive_docs.rs Add the syntax of references to their documentation summary. 2022-08-26 10:47:03 -07:00
process.rs Make doc for stdin field of process consistent 2022-08-21 01:56:26 -07:00
rt.rs Change Termination::report return type to ExitCode 2022-01-28 12:53:36 -08:00
time.rs Support setting file accessed/modified timestamps 2022-07-15 02:54:06 -07:00