Skip to content

Rename WriterByteConversions methods #8607

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
wants to merge 1 commit into from

Conversation

sfackler
Copy link
Member

The method names in std::rt::io::extensions::WriterByteConversions are
the same as those in std::io::WriterUtils and a resolve error causes
rustc to fail after trying to find an impl of io::Writer instead of
trying to look for rt::io::Writer as well.

@luqmana
Copy link
Member

luqmana commented Aug 20, 2013

I've been using both the extension reader & writer methods fine though. Do you have a test case?

@sfackler
Copy link
Member Author

use std::rt::io::{Writer, WriterByteConversions};

struct Foo;

impl Writer for Foo { 
    fn write(&mut self, _buf: &[u8]) {}
    fn flush(&mut self) {}
} 

fn main() {
    let mut f = Foo; 
    f.write_le_i32(0);
}
test.rs:12:1: 12:19 error: failed to find an implementation of trait std::io::Writer for Foo
test.rs:12  f.write_le_i32(0);
            ^~~~~~~~~~~~~~~~~~

@sfackler
Copy link
Member Author

Turns out the same goes for ReaderByteConversions. @brson r?

Test case:

use std::rt::io::{Reader, ReaderByteConversions};

struct Foo;

impl Reader for Foo {
    fn read(&mut self, _buf: &mut [u8]) -> Option<uint> { None }
    fn eof(&mut self) -> bool { true }
}

fn main() {
    let mut f = Foo; 
    f.read_u8();
}
test.rs:12:1: 12:13 error: failed to find an implementation of trait std::io::Reader for Foo
test.rs:12  f.read_u8();
            ^~~~~~~~~~~~

@sfackler
Copy link
Member Author

@brson had to rebase, r?

The method names in std::rt::io::extensions::WriterByteConversions are
the same as those in std::io::WriterUtils and a resolve error causes
rustc to fail after trying to find an impl of io::Writer instead of
trying to look for rt::io::Writer as well.

Same goes for ReaderByteConversions.
bors added a commit that referenced this pull request Aug 25, 2013
The method names in std::rt::io::extensions::WriterByteConversions are
the same as those in std::io::WriterUtils and a resolve error causes
rustc to fail after trying to find an impl of io::Writer instead of
trying to look for rt::io::Writer as well.
@bors bors closed this Aug 25, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 7, 2022
…95,giraffate

Allow running `cargo dev lint` on a package directory

Allows you run the local clippy in a specified directory, e.g. allowing

```sh
# Lint a ui-cargo test
cargo dev lint tests/ui-cargo/wildcard_dependencies/fail

# Lint some other project
cargo dev lint ~/my-project
```

The `target` directory is set to a tempdir which isn't ideal for medium/large projects as it would be compiled from scratch. This is to avoid cached clippy messages where you `cargo dev lint dir`, change something in clippy, and run `cargo dev lint dir` again

changelog: Dev: `cargo dev lint` can now be run on a package directory
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

Successfully merging this pull request may close these issues.

4 participants