Skip to content

Reexport of std::rt::io::extensions::ReaderUtil is broken #9779

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

Closed
sfackler opened this issue Oct 9, 2013 · 0 comments
Closed

Reexport of std::rt::io::extensions::ReaderUtil is broken #9779

sfackler opened this issue Oct 9, 2013 · 0 comments
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically

Comments

@sfackler
Copy link
Member

sfackler commented Oct 9, 2013

use std::rt::io::ReaderUtil;
use std::rt::io::mem::MemReader;

fn foo() {
    let mut 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;

fn foo() {
    let mut buf = MemReader::new(~[]);
    buf.read_bytes(1);
}
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.
bors added a commit that referenced this issue Oct 10, 2013
This works around #9779, but is probably the right thing to do anyways
since that's the module where all of the documentation for those traits
lives.
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 21, 2022
…r=Jarcho

fix turbofish in suggest message

changelog: [`unnecessary_join`] fix turbofish in suggest message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

1 participant