<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/sys/random, branch beta</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=beta</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=beta'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-28T22:07:15+00:00</updated>
<entry>
<title>std: Start supporting WASIp2 natively</title>
<updated>2025-08-28T22:07:15+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2025-08-26T20:53:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5d81f033a5ab2fce07898a22ad8c607380812cf7'/>
<id>urn:sha1:5d81f033a5ab2fce07898a22ad8c607380812cf7</id>
<content type='text'>
This commit is the start of an effort to support WASIp2 natively in the
standard library. Before this commit the `wasm32-wasip2` target behaved
exactly like `wasm32-wasip1` target by importing APIs from the core wasm
module `wasi_snapshot_preview1`. These APIs are satisfied by the
`wasm-component-ld` target by using an [adapter] which implements WASIp1
in terms of WASIp2. This adapter comes at a cost, however, in terms of
runtime indirection and instantiation cost, so ideally the adapter would
be removed entirely. The purpose of this adapter was to provide a
smoother on-ramp from WASIp1 to WASIp2 when it was originally created.

The `wasm32-wasip2` target has been around for long enough now that it's
much more established. Additionally the only thing historically blocking
using WASIp2 directly was implementation effort. Work is now underway to
migrate wasi-libc itself to using WASIp2 directly and now seems as good
a time as any to migrate the Rust standard library too.

Implementation-wise the milestones here are:

* The `wasm32-wasip2` target now also depends on the `wasi` crate at
  version 0.14.* in addition to the preexisting dependency of 0.11.*.
  The 0.14.* release series binds WASIp2 APIs instead of WASIp1 APIs.
* Some preexisting naming around `mod wasi` or `wasi.rs` was renamed to
  `wasip1` where appropriate. For example `std::sys::pal::wasi` is now
  called `std::sys::pal::wasip1`.
* More platform-specific WASI modules are now split between WASIp1 and
  WASIp2. For example getting the current time, randomness, and
  process arguments now use WASIp2 APIs directly instead of using WASIp1
  APIs that require an adapter.

It's worth pointing out that this PR does not migrate the entire
standard library away from using WASIp1 APIs on the `wasm32-wasip2`
target. Everything related to file descriptors and filesystem APIs is
still using WASIp1. Migrating that is left for a future PR. In the
meantime the goal of this change is to lay the groundwork necessary for
migrating in the future. Eventually the goal is to drop the `wasi`
0.11.* dependency on the `wasm32-wasip2` target (the `wasm32-wasip1`
target will continue to retain this dependency).

[adapter]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-preview1-component-adapter/README.md
</content>
</entry>
<entry>
<title>library: Migrate from `cfg_if` to `cfg_select`</title>
<updated>2025-08-16T12:28:31+00:00</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2025-08-10T21:25:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1ae4a0cc3487f28b29f36afe8056535afad21e7b'/>
<id>urn:sha1:1ae4a0cc3487f28b29f36afe8056535afad21e7b</id>
<content type='text'>
Migrate the standard library from using the external `cfg_if` crate to
using the now-built-in `cfg_select` macro.

This does not yet eliminate the dependency from
`library/std/Cargo.toml`, because while the standard library itself no
longer uses `cfg_if`, it also incorporates the `backtrace` crate, which
does.

Migration assisted by the following vim command (after selecting the
full `cfg_if!` invocation):

```
'&lt;,'&gt;s/\(cfg_if::\)\?cfg_if/cfg_select/ | '&lt;,'&gt;s/^\( *\)} else {/\1}\r\1_ =&gt; {/c | '&lt;,'&gt;s/^\( *\)} else if #\[cfg(\(.*\))\] /\1}\r\1\2 =&gt; /e | '&lt;,'&gt;s/if #\[cfg(\(.*\))\] {/\1 =&gt; {/e
```

This is imperfect, but substantially accelerated the process. This
prompts for confirmation on the `} else {` since that can also appear
inside one of the arms. This also requires manual intervention to handle
any multi-line conditions.
</content>
</entry>
<entry>
<title>Remove `[T]::array_chunks(_mut)`</title>
<updated>2025-07-28T06:03:07+00:00</updated>
<author>
<name>Scott McMurray</name>
<email>scottmcm@users.noreply.github.com</email>
</author>
<published>2025-07-01T16:33:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=173926da2bd94bde24740a4b9e6b1bac1bfcb910'/>
<id>urn:sha1:173926da2bd94bde24740a4b9e6b1bac1bfcb910</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #143776 - no1wudi:fix, r=tgross35</title>
<updated>2025-07-13T05:21:19+00:00</updated>
<author>
<name>León Orell Valerian Liehr</name>
<email>me@fmease.dev</email>
</author>
<published>2025-07-13T05:21:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5d5645972ffa96c1e2266d819fae27f9028f7be0'/>
<id>urn:sha1:5d5645972ffa96c1e2266d819fae27f9028f7be0</id>
<content type='text'>
std: move NuttX to use arc4random for random number generation

arc4random support in libc merged in https://github.com/rust-lang/libc/pull/4464, so:

* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security compared to the legacy random number generation methods.
</content>
</entry>
<entry>
<title>std: move NuttX to use arc4random for random number generation</title>
<updated>2025-07-11T09:31:27+00:00</updated>
<author>
<name>Huang Qi</name>
<email>huangqi3@xiaomi.com</email>
</author>
<published>2025-07-11T09:31:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=074846289a4f69d8057bc3ee7789728f560e1ec8'/>
<id>urn:sha1:074846289a4f69d8057bc3ee7789728f560e1ec8</id>
<content type='text'>
* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's
  built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security
compared to the legacy random number generation methods.

Signed-off-by: Huang Qi &lt;huangqi3@xiaomi.com&gt;
</content>
</entry>
<entry>
<title>setup CI and tidy to use typos for spellchecking and fix few typos</title>
<updated>2025-07-03T07:51:06+00:00</updated>
<author>
<name>klensy</name>
<email>klensy@users.noreply.github.com</email>
</author>
<published>2024-12-07T10:51:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c76d032f0144b650a438ee1efba89c475e0b115b'/>
<id>urn:sha1:c76d032f0144b650a438ee1efba89c475e0b115b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: sys: random: uefi: Provide rdrand based fallback</title>
<updated>2025-06-06T04:44:08+00:00</updated>
<author>
<name>Ayush Singh</name>
<email>ayush@beagleboard.org</email>
</author>
<published>2025-05-21T07:15:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=669564d0281999a5568159c9d82dea7e51429c59'/>
<id>urn:sha1:669564d0281999a5568159c9d82dea7e51429c59</id>
<content type='text'>
Some UEFI systems based on American Megatrends Inc. v3.3 do not provide
RNG support [1]. So fallback to rdrand in such cases.

[1]: https://github.com/rust-lang/rust/issues/138252#issuecomment-2891270323

Signed-off-by: Ayush Singh &lt;ayush@beagleboard.org&gt;
</content>
</entry>
<entry>
<title>use generic Atomic type where possible</title>
<updated>2025-04-26T23:18:08+00:00</updated>
<author>
<name>Christopher Durham</name>
<email>cad97@cad97.com</email>
</author>
<published>2024-09-19T04:15:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4d93f6056824c338751f19356d33bb61ce818749'/>
<id>urn:sha1:4d93f6056824c338751f19356d33bb61ce818749</id>
<content type='text'>
in core/alloc/std only for now, and ignoring test files

Co-authored-by: Pavel Grigorenko &lt;GrigorenkoPV@ya.ru&gt;
</content>
</entry>
<entry>
<title>Change the syntax of the internal `weak!` macro</title>
<updated>2025-03-26T15:25:05+00:00</updated>
<author>
<name>Mads Marquart</name>
<email>mads@marquart.dk</email>
</author>
<published>2025-03-26T14:23:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a7bafc0afc3dba988a7bf85198c493b20523eaa0'/>
<id>urn:sha1:a7bafc0afc3dba988a7bf85198c493b20523eaa0</id>
<content type='text'>
Change the syntax to include parameter names and a trailing semicolon.

Motivation:
- Mirror the `syscall!` macro.
- Allow rustfmt to format it (when wrapped in parentheses).
- For better documentation (having the parameter names available in
  the source code is a bit nicer).
- Allow future improvements to this macro where we can sometimes use the
  symbol directly when it's statically known to be available.
</content>
</entry>
<entry>
<title>Fix build failure on Trusty</title>
<updated>2025-03-18T17:05:01+00:00</updated>
<author>
<name>Taiki Endo</name>
<email>te316e89@gmail.com</email>
</author>
<published>2025-03-18T17:05:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=68267d0aedfda5db4dc9d233f02fd31d7c53d02f'/>
<id>urn:sha1:68267d0aedfda5db4dc9d233f02fd31d7c53d02f</id>
<content type='text'>
</content>
</entry>
</feed>
