The Wire · Showcase
BOUNDED RANDOM SAMPLING LANDS IN CORE, STDLIB SEMVER CHECKS DEBUT
By RepoJournal · Filed · About Rust
Rust's random module just got smarter: Lemire's algorithm now powers bounded sampling in RangeInclusive, while a new semver compatibility test ensures the standard library stays API-stable.
The core team shipped bounded random sampling [1] using Lemire's algorithm, the same approach FreeBSD uses for arc4random_uniform. This lands a long-requested Distribution trait for RangeInclusive, preventing the typo errors that plague unconstrained range sampling. In parallel, stdlib gains automated semver checking [2] via cargo-semver-checks, executed through a new `x test std-semver-check` command in bootstrap. The implementation aims to catch API breaks before they land on users. Triagebot got a data refresh [3] removing the allowed_merge_apps field from team configs, and fixed a race condition [4] between community review label removal and assignee updates. Over 77 commits across the stack this cycle, with the Cargo team consolidating tooling [5] by importing cargo-tracker and cargo-meetings as Cargo scripts for internal use.
One email a day. Unsubscribe in one click.
Keep up with Rust in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review bounded sampling implementation for RangeInclusive performance characteristics in your code paths rust-lang/rust [plan]
- → Integrate stdlib semver checks into your CI workflows when available rust-lang/rust [monitor]
- → Update any local triagebot configurations to remove allowed_merge_apps field rust-lang/triagebot [plan]
References
- [1] core: implement bounded random sampling ↗ rust-lang/rust
- [2] Add semver check test command for checking API compatibility of stdlib ↗ rust-lang/rust
- [3] Merge pull request #2467 from rust-lang/update-team-data-to-remove-allowed_merge_apps-field rust-lang/triagebot
- [4] Fix race when removing the community review label and assigning last approvee ↗ rust-lang/triagebot
- [5] feat(tools): import cargo-tracker and cargo-meetings ↗ rust-lang/cargo-team