Skip to content

rust_1_96: support std::range types#1792

Open
dhardy wants to merge 6 commits into
masterfrom
push-mlmorwszrtvl
Open

rust_1_96: support std::range types#1792
dhardy wants to merge 6 commits into
masterfrom
push-mlmorwszrtvl

Conversation

@dhardy

@dhardy dhardy commented Jun 23, 2026

Copy link
Copy Markdown
Member
  • Added a CHANGELOG.md entry

Summary

Support construction of Uniform via TryFrom and sampling using SampleRange with std::range types, mirroring existing support for std::ops range types.

Since this requires Rust 1.96 which is newer than our MSRV, introduce a rust_1_96 feature gate (will be dropped after the MSRV advances sufficiently).

Motivation

Closes #1784, #1785. CC @kristoff-mattei.

Details

Includes some doc tweaks:
image
image

@dhardy dhardy requested a review from vks June 23, 2026 09:22
@dhardy dhardy force-pushed the push-mlmorwszrtvl branch from ed3331a to 67c419a Compare June 23, 2026 09:23
Comment thread Cargo.toml
alloc = []

# Option: support the std::range types (requires Rust >= 1.96.0).
rust_1_96 = []

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should just bump rust-version and be done with it. Situations like this are what MSRV-aware resolver was introduced for.

Should we do it now or later is a separate question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend the impl_sample_range_u to implement the new std/core::range::Range* types.

3 participants