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

compilation error: parameter Self is never used #29

Closed
zimbatm opened this issue Apr 23, 2015 · 6 comments
Closed

compilation error: parameter Self is never used #29

zimbatm opened this issue Apr 23, 2015 · 6 comments

Comments

@zimbatm
Copy link

zimbatm commented Apr 23, 2015

I'm very new to rust otherwise I would fix this issue myself. Is it possible that I am using the wrong version of rust ?

$ rustc -V
rustc 1.0.0-beta (built 2015-04-04)
$ cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading quickcheck v0.2.14
   Compiling byteorder v0.3.8 (file:///Users/zimbatm/code/github.com/BurntSushi/byteorder)
src/lib.rs:87:1: 201:2 error: parameter `Self` is never used
src/lib.rs:87 pub trait ByteOrder {
src/lib.rs:88     /// Reads an unsigned 16 bit integer from `buf`.
src/lib.rs:89     ///
src/lib.rs:90     /// Task failure occurs when `buf.len() < 2`.
src/lib.rs:91     fn read_u16(buf: &[u8]) -> u16;
src/lib.rs:92
              ...
src/lib.rs:201:2: 201:2 help: consider removing `Self` or using a marker such as `core::marker::PhantomFn`
error: aborting due to previous error
Could not compile `byteorder`.

To learn more, run the command again with --verbose.
@BurntSushi
Copy link
Owner

Yup, wrong version. Try upgrading to beta2.

@zimbatm
Copy link
Author

zimbatm commented Apr 23, 2015

Ok. v0.3.7 compiles fine but I wasn't able to pin the version in my Cargo.toml

@BurntSushi
Copy link
Owner

No, I mean upgrade your rustc. You're using beta1. You need beta2. You shouldn't need to be pinning anytbing in Cargo.toml unless you have to use beta1. (In which case, you'd need "=0.3.7".)

@zimbatm
Copy link
Author

zimbatm commented Apr 23, 2015

Yeah sorry I understood. My code is working fine with beta1 and beta2 isn't packaged for homebrew just yet (and I don't really like the idea of running curl ... | sudo sh). Thanks for the pointer for version pinning !

@zimbatm zimbatm closed this as completed Apr 23, 2015
@BurntSushi
Copy link
Owner

(and I don't really like the idea of running curl ... | sudo sh)

Thankfully, you don't have to:

curl -O https://static.rust-lang.org/rustup.sh
sh rustup.sh --prefix $HOME/rust  # or whatever

Glad you got it working though!

@zimbatm
Copy link
Author

zimbatm commented Apr 23, 2015

🙇

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