I have been out of rust for a bit, and coming back to it, I am having
a difficult time adapting the front page example at
http://www.rust-lang.org/ to the trunk version of rust (updated last
night). I turned the example to
--------
use std::*;
fn main() {
for ["Alice", "Bob", "Carol"].each |&name| {
do task::spawn {
let v = rand::rng().shuffle([1, 2, 3]);
for v.each |&num| {
io::print(fmt!("%s says: '%d'\n", name, num))
}
}
}
}
--------
and rustc complains with
--------
hello.rs:6:20: 6:51 error: type `std::rand::IsaacRng` does not
implement any method in scope named `shuffle`
hello.rs:6 let v = rand::rng().shuffle([1, 2, 3]);
--------
and a type inference error triggered by this part failing. In
libstd/rand.rs, RngUtil seems to be defined for everything
implementing Rng, which IsaacRng does. Is this a bug or is it some
change in the lookup?
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev