"Self" errors on Windows


#1

Hi, Rust beginner here trying to utilize my first library. I can’t figure out what to do and can’t find information about this error anywhere


Compiling byteorder v0.3.10
Compiling interpolation v0.0.6
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:131:30: 131:42 error: failed to resolve. Use of undeclared type or module Self
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:131 fn scale(&self, scalar: &Self::Scalar) -> Self {
^~~~~~~~~~~~
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:131:30: 131:42 error: use of undeclared type name Self::Scalar
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:131 fn scale(&self, scalar: &Self::Scalar) -> Self {
^~~~~~~~~~~~
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:164:30: 164:42 error: failed to resolve. Use of undeclared type or module Self
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:164 fn scale(&self, scalar: &Self::Scalar) -> Self {
^~~~~~~~~~~~
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:164:30: 164:42 error: use of undeclared type name Self::Scalar
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:164 fn scale(&self, scalar: &Self::Scalar) -> Self {
^~~~~~~~~~~~
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:200:30: 200:42 error: failed to resolve. Use of undeclared type or module Self
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:200 fn scale(&self, scalar: &Self::Scalar) -> Self {
^~~~~~~~~~~~
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:200:30: 200:42 error: use of undeclared type name Self::Scalar
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\interpolation-0.0.6\src\spatial.rs:200 fn scale(&self, scalar: &Self::Scalar) -> Self {
^~~~~~~~~~~~
error: aborting due to 6 previous errors
Build failed, waiting for other jobs to finish…
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:85:1: 199:2 error: parameter Self is never used
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:85 pub trait ByteOrder {
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:86 /// Reads an unsigned 16 bit integer from buf.
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:87 ///
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:88 /// Panics when buf.len() < 2.
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:89 fn read_u16(buf: &[u8]) -> u16;
C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:90

C:\Users\Windows.cargo\registry\src\github.com-1ecc6299db9ec823\byteorder-0.3.10\src\lib.rs:199:2: 199:2 help: consider removing Self or using a marker such as core::marker::PhantomFn
error: aborting due to previous error
Could not compile interpolation.


#2

Hi, what’s your rustc version? Maybe it’s not up to date


#3

It says it’s 1.0.0-beta (9854143cb 2015-04-02), but I just downloaded it a couple days ago


#4

You probably used the link in the book which is, unfortunately, out of date. Use the link on the the main website (rust-lang.org).


#5

Thank you, I got past those errors, and though I still can’t compile, I think the new errors are library-specific, have to look into it more