Book Listing 11-1: Compiler Error

Hello All, I am noob working through the book and am currently at listing 11-1 (the “adder” test function).

When I compile, I get this result:

I gather that the gist of the message is if I was using Rust 1.34.2 everything would be fine but there is a problem with one of the crates since I am using Rust 1.35.0.

Should I roll back to 1.34.2 OR is there some tweaking I can do?

Thanks very much!
Jerry

How did you install/update Rust?

It actually looks like “this compiler” (i.e. the one you’re invoking through Cargo) is 1.34.2, but it’s trying to use the 1.35 stdlib distribution.

The output of cargo --version, rustc --version, rustup --version, and rustup show would help as well.

Based on just looking at the .rustup paths, it looks like your stable toolchain is in some sort of phantom state between 1.34.2 and 1.35. Did you interrupt a rustup update at some point?

2 Likes

Thank you CAD97! - your post clued me into the fix. What I had was a borked install rather than some setting(s) I was missing or had wrong, etc. Last week, I did in fact have trouble when I upgraded from 1.34.2 to 1.35.0 with Trend Micro (on my work computer) flagging all rust exes as problems. Our IT admin took care of that and that now works fine.

I am assuming the corruption happened with that or maybe it was something else I did. A few days ago, the last time I used Rust on this computer it was showing 1.35.0 but after reading your post, I saw it was 1.34.2. I nuked my Rust setup on this computer then reinstalled fresh which brought in 1.35.0.

I now get the correct output:

Thank your for your help!