Additionally, io::println can now just be println, and int::to_str(x) is now x.to_str()
On Fri, Aug 23, 2013 at 6:44 PM, Tim Chevalier <[email protected]> wrote: > On Fri, Aug 23, 2013 at 3:42 PM, Renato Lenzi <[email protected]> wrote: >> Hi there. I've installed Rust 7 on Windows 7. I'm trying to compile this >> simple code: >> >> fn sum (x: int, y : int) -> int >> { >> x + y >> } >> >> fn main() >> { >> let x =sum(2, 3); >> io::println(int::to_str(x)); >> } >> >> but i get: >> >> 00015.rs:9:13: 9:24 error: unresolved name >> 00015.rs:9 io::println(int::to_str(x)); >> ^~~~~~~~~~~ >> 00015.rs:9:13: 9:24 error: use of undeclared module `int` >> 00015.rs:9 io::println(int::to_str(x)); >> ^~~~~~~~~~~ >> 00015.rs:9:13: 9:24 error: unresolved name `int::to_str`. >> 00015.rs:9 io::println(int::to_str(x)); >> ^~~~~~~~~~~ >> 00015.rs:9:1: 9:12 error: unresolved name >> 00015.rs:9 io::println(int::to_str(x)); >> ^~~~~~~~~~~ >> 00015.rs:9:1: 9:12 error: use of undeclared module `io` >> 00015.rs:9 io::println(int::to_str(x)); >> ^~~~~~~~~~~ >> 00015.rs:9:1: 9:12 error: unresolved name `io::println`. >> 00015.rs:9 io::println(int::to_str(x)); >> ^~~~~~~~~~~ >> error: aborting due to 6 previous errors >> >> I used, until yesterday, Rust 06 and it was all ok. >> Any ideas on how to fix this problem? > > In Rust 0.7 you have to import standard library modules explicitly. If > you add the following line at the beginning: > > use std::io; > > it should compile. > > Cheers, > Tim > > -- > Tim Chevalier * http://catamorphism.org/ * Often in error, never in doubt > "Being queer is not about a right to privacy; it is about the freedom > to be public, to just be who we are." -- anonymous, June 1990 > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
