Skip to content
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

Examples from the doc not working. #156

Open
lunemec opened this issue Sep 9, 2016 · 1 comment
Open

Examples from the doc not working. #156

lunemec opened this issue Sep 9, 2016 · 1 comment

Comments

@lunemec
Copy link

lunemec commented Sep 9, 2016

rustc 1.11.0 (9b21dcd6a 2016-08-15)

src/main.rs:4:5: 4:26 error: unresolved import `std::io::timer::sleep`. Could not find `timer` in `std::io` [E0432]
src/main.rs:4 use std::io::timer::sleep;
                  ^~~~~~~~~~~~~~~~~~~~~
src/main.rs:4:5: 4:26 help: run `rustc --explain E0432` to see a detailed explanation
src/main.rs:3:5: 3:34 error: module `duration` is private
src/main.rs:3 use std::time::duration::Duration;
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:12:28: 12:34 error: mismatched types [E0308]
src/main.rs:12     let mut buffer = [0u8, ..1024];
                                          ^~~~~~
src/main.rs:12:28: 12:34 help: run `rustc --explain E0308` to see a detailed explanation
src/main.rs:12:28: 12:34 note: expected type `u8`
src/main.rs:12:28: 12:34 note:    found type `std::ops::RangeTo<_>`
src/main.rs:14:11: 14:33 error: no associated item named `milliseconds` found for type `std::time::Duration` in the current scope
src/main.rs:14     sleep(Duration::milliseconds(50));
                         ^~~~~~~~~~~~~~~~~~~~~~
src/main.rs:16:23: 16:28 error: no method named `write` found for type `nanomsg::Socket` in the current scope
src/main.rs:16     match push_socket.write(b"foobar") {
                                     ^~~~~
src/main.rs:16:23: 16:28 help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
src/main.rs:16:23: 16:28 help: candidate #1: `use std::io::Write`
src/main.rs:21:23: 21:27 error: no method named `read` found for type `nanomsg::Socket` in the current scope
src/main.rs:21     match pull_socket.read(&mut buffer) {
                                     ^~~~
src/main.rs:21:23: 21:27 help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
src/main.rs:21:23: 21:27 help: candidate #1: `use std::io::Read`
error: aborting due to 4 previous errors
error: Could not compile `nanomsgtest`.
@blabaere
Copy link
Collaborator

blabaere commented Sep 9, 2016

Hi,

The stored documentation is sadly out-dated, you'll find up-to-date examples in both the doc comments and the examples folder. The problem is already mentioned in issue #147, I think I'll give this a try in the coming weeks.

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