Skip to content

Rand::rand() and Rng::gen() should not require Rng to be Sized #190

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

Closed
kryptan opened this issue Nov 4, 2017 · 2 comments
Closed

Rand::rand() and Rng::gen() should not require Rng to be Sized #190

kryptan opened this issue Nov 4, 2017 · 2 comments

Comments

@kryptan
Copy link

kryptan commented Nov 4, 2017

This prevents Rng from being a trait object

@dhardy
Copy link
Member

dhardy commented Nov 5, 2017

This will be fixed

rfdonnelly added a commit to rfdonnelly/rvs that referenced this issue Nov 11, 2017
* Fixes unable to use Rng trait object with range::sample

  rust-random/rand#190

* Adds support for inclusive range

  Replace rvs's own RangeInclusive with rand's new Range::new_inclusive

  rust-random/rand#188
@dhardy
Copy link
Member

dhardy commented Feb 15, 2018

This requires either #244 or, more simply, replacing rng.gen() with (&mut rng).gen().

See test_rng_trait_object.

I'm closing this because the relevant discussion belongs in #244.

@dhardy dhardy closed this as completed Feb 15, 2018
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

No branches or pull requests

2 participants