You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::rt::io::ReaderUtil;use std::rt::io::mem::MemReader;fnfoo(){letmut buf = MemReader::new(~[]);
buf.read_bytes(1);}
~/temp ❯ rustc --lib test.rs
test.rs:6:1: 6:19 error: failed to find an implementation of trait std::io::Reader for std::rt::io::mem::MemReader
test.rs:6 buf.read_bytes(1);
^~~~~~~~~~~~~~~~~~
If I modify ReaderUtil to add an underscore to read_bytes to avoid the name conflict, I get this error instead:
test.rs:6:1: 6:19 error: type `std::rt::io::mem::MemReader` does not implement any method in scope named `read_bytes_`
use std::rt::io::extensions::ReaderUtil;
test.rs:6 m.read_bytes_(10);
^~~~~~~~~~~~~~~~~~
But if I make extensions a public module and use ReaderUtil from there, everything works:
use std::rt::io::extensions::ReaderUtil;use std::rt::io::mem::MemReader;fnfoo(){letmut buf = MemReader::new(~[]);
buf.read_bytes(1);}
The text was updated successfully, but these errors were encountered:
sfackler
added a commit
to sfackler/rust
that referenced
this issue
Oct 9, 2013
This works around rust-lang#9779, but is probably the right thing to do anyways
since that's the module where all of the documentation for those traits
lives.
If I modify
ReaderUtil
to add an underscore toread_bytes
to avoid the name conflict, I get this error instead:But if I make
extensions
a public module and use ReaderUtil from there, everything works:The text was updated successfully, but these errors were encountered: