-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rng::gen_index; no usize for Standard #1471
Conversation
I added
|
Do we still need |
It turns out that due to the bounds on
|
#1487 was merged instead |
CHANGELOG.md
entrySummary
Follows #1470, hence the first commit of this PR is "cfg-gate IndexVec::USize".
Motivation
Solve #1399 by removing support for sampling
usize
,isize
through the usual methods.Details
This is potentially the most drastic and problematic approach, but seems to work fine at least for
rand
's tests. Specifically, it removes:Standard
distribution support forusize
,isize
and non-zero and SIMD variantsUniform
distribution support for the same typesFill
-ing[usize]
,[isize]
Rng::gen_index
WeightedAliasIndex
no longer supportsisize
orusize
weightsThis is meant for discussion. Potentially we could also use in a release with the option to add back support for the above types (this would be non-breaking).
fn Rng::gen_index
supports various range types overusize
using a private trait bound. Unorthodox and it's possible that the lack of ability for downstream crates to write generics over this would be an issue, but that is really not an intended feature. (We could also simplify this down to justRangeTo
; that's all thatrand
uses anyway.)We might also want to expose
UniformUsize
(used inrand::distr::slice
), probably underrand::distr::uniform
(alongsideUniformInt
, possibly without implementingSampleUniform
though that is an option).