$ the-wire · showcase
crates.io hardens owner login parsing, rustc reworks custom MIR casts
By RepoJournal · Filed · About Rust · Composed from the cited sources · methodology
crates.io now rejects empty and over-long owner login components instead of silently ignoring trailing input, while rustc adds arbitrary casts to custom MIR and stops linting argument-position braces in edition 2024 and later.
crates.io tightened its owner login parser [1]. Logins with empty components or more than three colon-separated components are now rejected rather than having trailing input silently dropped, and prefixed usernames get a dedicated unsupported error instead of being parsed as GitHub teams. Anyone scripting against the owners API with hand-built login strings should expect hard errors where partial parses used to slip through.
On the compiler side, rustc added arbitrary casts to custom MIR through a new enum in `intrinsics::mir` that closely matches the compiler's `CastKind` enum [2]. Previously custom MIR offered five casting paths, three of them functions with a hard-coded cast kind. Separately, the `unused_braces` lint will stop firing on argument-position braces for `FunctionArg` and `MethodArg` in edition 2024 and later [3], because in Rust 2024 braces around function and method arguments can affect temporary drop scope. The lint is AST level, so rather than give it semantic reasoning, chenyukang chose to stop linting those positions in the newer edition.
`cg_ssa`'s handling of indirect returns via `sret` was refactored in a take-two of earlier work [4]. The pull request states the current `PassMode::Indirect` handling is "fundamentally incompatible with the requirements of the GCC backend" [4] and is worked around in a brittle way that breaks on ARM. The author confirms the original approach works and is ready to merge. `HygieneEncodeContext` also got a refactor with minor perf improvements, most notably removing `Lock`s [5], as the first part of a larger effort.
rustup fixed Windows CI to propagate check and clippy failures [6]. The default shell for GNU targets on Windows is `pwsh`, which does not exit on first error, so failures were being ignored [7]. The follow-up refactor uses PowerShell 7 solely for Windows actions with a shared `pwsh` shell and native failure propagation, keeping Bash overrides where needed [8], and replaces `xargs touch` with `ForEach-Object` and `Get-Item` to drop the xargs and touch dependency in Windows jobs [9]. cc-rs added CUDA support for Windows on ARM [10].
Action items
- → Audit owners API callers for login strings with empty or extra colon-separated components, now rejected instead of partially parsed rust-lang/crates.io [plan]
- → Stop relying on unused_braces firing for function and method argument braces in edition 2024 and later rust-lang/rust [monitor]
- → Rustup contributors can rely on Windows CI check and clippy failures now failing the build rust-lang/rustup [monitor]
References
- [1] controllers/owners: Improve `OwnerLogin` parser ↗ rust-lang/crates.io
- [2] Implement arbitrary casts in custom mir ↗ rust-lang/rust
- [3] Skip linting unused braces for FunctionArg and MethodArg context for 2024 later ↗ rust-lang/rust
- [4] Refactor the way cg_ssa handles indirect returns (returns via `sret`) — Take 2 ↗ rust-lang/rust
- [5] Refactor `HygieneEncodeContext` ↗ rust-lang/rust
- [6] fix(ci): propagate Windows check and clippy failures ↗ rust-lang/rustup
- [7] Fix Windows CI's Powershell not propagate error by default ↗ rust-lang/rustup
- [8] refactor(ci): use Powershell 7 solely for Windows actions ↗ rust-lang/rustup
- [9] refactor(ci): replace xargs touch with native PowerShell ↗ rust-lang/rustup
- [10] Add support for CUDA on Windows on ARM. (#1893) ↗ rust-lang/cc-rs