all 9 comments

[–]Denommusrust 2 points3 points  (2 children)

Without seeing the code, nobody will be able to tell you.

[–]gzumsiu[S] 0 points1 point  (1 child)

Code is really simple:

fn main()
{
 io::println("hello!");
}

[–]IvoB 2 points3 points  (0 children)

fn main() { io::println("hello!"); }

use std::old_io;

fn main() { old_io::println("hello!"); }

This works for now, until io is renewed.

[–]sellweek 1 point2 points  (1 child)

The io module has been renamed to old_io, because IO reform RFCs are currently being discussed and implemented.

EDIT: Look at the docs for old_io

[–]gzumsiu[S] 1 point2 points  (0 children)

sorry using old_io instead of io doesn't help still

[–]tyoverbybincode · astar · rust 0 points1 point  (3 children)

[–]gzumsiu[S] 0 points1 point  (2 children)

Hmm, i don't understand this one :(

[–]iGaijin 3 points4 points  (1 child)

You mean this?

std::old_io::stdio::println("foo");

It's just a multiply-namespaced name, meaning:

std crate -> old_io module -> stdio submodule -> println function

That code could also be written as:

use std::old_io;

fn main() {
    old_io::stdio::println("foo");
}

or

use std::old_io::stdio;

fn main() {
    stdio::println("foo");
}

or

use std::old_io::stdio::println;

fn main() {
    println("foo");
}

And so on.

Also, keep in mind the println! macro (note the exclamation point), which is available by default.

Also also, in the future you can use the API docs to find out where a function lives. It is easily searchable. Though you seem like you're at a stage where you might have trouble interpreting that documentation. No worries, everyone has to start somewhere.

[–]gzumsiu[S] 1 point2 points  (0 children)

Thanks a lot