Aatch / ramp

RAMP - Rust Arithmetic in Multiple Precision
Apache License 2.0
263 stars 38 forks source link

gen_uint() method cant be called on ThreadRng due to unsatisfied Trait bounds #124

Closed PrisionMike closed 3 years ago

PrisionMike commented 3 years ago

The doc code doesn't work. I tried different rngs from rand. all of these show the same error at build

let gma: Int = rng.gen_uint(256);
   |                        ^^^^^^^^ method cannot be called on `ThreadRng` due to unsatisfied trait bounds
.cargo\registry\src\github.com-1ecc6299db9ec823\rand-0.8.3\src\rngs\thread.rs:61:1
   |
61 | pub struct ThreadRng {
   | --------------------
   | |
   | doesn't satisfy `ThreadRng: RandomInt`
   | doesn't satisfy `ThreadRng: rand::Rng`
   |
   = note: the following trait bounds were not satisfied:
           `ThreadRng: rand::Rng`
           which is required by `ThreadRng: RandomInt`
PrisionMike commented 3 years ago

rustc 1.54.0-nightly ramp = 0.5.9 rand = 0.8.3

PrisionMike commented 3 years ago

I used rand = 0.5 and it runs now. The issue may be closed as the dependencies do say rand = 0.5

rozbb commented 3 years ago

Version 0.6 now uses rand = 0.8 as a dep, so that should fix the issue. Sorry about that.