$ the-wire · showcase
Closures become MaybeDangling, AArch64 SVE lands in inline asm
By RepoJournal · Filed · About Rust
Rust's aliasing model will now ignore references and Boxes captured by closures, and inline assembly gains AArch64 SVE support.
Rust nightly merges a rollup that adds a Tier-3 target `powerpc64-sony-ps3` and other changes [1]. More consequentially, a new PR makes closures (and coroutines) act like MaybeDangling, so the aliasing model "will entirely ignore references and `Box`es passed around as closure captures" [2]. This removes a subtle footgun that has caused multiple soundness issues, including in the standard library's thread spawning logic.
Inline assembly now supports AArch64 SVE registers [3], which enables hand-written SVE code inside `asm!` blocks on AArch64 targets. Miri also gained the last unsupported AES intrinsic, `llvm.x86.aesni.aeskeygenassist`, completing support for the `aes` target feature [4], and fixed a TCP readiness bug that previously caused a global deadlock in a newly added test [5].
In libc, `tmpnam` and `tempnam` are now deprecated on Unix platforms where they exist because they are TOCTOU-prone and not thread-safe; glibc docs say "Never use this function" [6]. Socket constants continue moving to `src/new` for glibc, which fixes a ctest failure involving `__socket_type` [7], and the `c_enum!` macro now supports field attributes [8].
The crates.io index saw routine crate updates and one new crate, `mailtea` [9].
Action items
- → If you write unsafe code with closure captures, review after the alias-model change lands in nightly rust-lang/rust [monitor]
- → Use AArch64 SVE registers in inline asm once the feature stabilizes rust-lang/rust [monitor]
- → Audit code using tmpnam or tempnam under libc; they are deprecated rust-lang/libc [plan]
References
- [1] Rollup of 25 pull requests ↗ rust-lang/rust
- [2] make closures act like MaybeDangling ↗ rust-lang/rust
- [3] Adds support for AArch64 SVE to inline assembly ↗ rust-lang/rust
- [4] Add `llvm.x86.aesni.aeskeygenassist` support ↗ rust-lang/miri
- [5] Manually set initial TCP socket readiness ↗ rust-lang/miri
- [6] unix: Deprecate the POSIX-obsoleted `tmpnam`, `tempnam` ↗ rust-lang/libc
- [7] glibc: Move more socket constants to `src/new` ↗ rust-lang/libc
- [8] macros: Support field attributes in `c_enum!` ↗ rust-lang/libc
- [9] Create crate `mailtea` ↗ rust-lang/crates.io-index