-
Notifications
You must be signed in to change notification settings - Fork 3.6k
ch2: unused result warning differs #1006
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
Conversation
I'm seeing other differences in compiler errors later on. Not sure if I'm using an old rustc release compared to the book or if the book is out-of-date. variables/main.rs
rather than
|
The book is out of date; for your second example, that error actually changed due to the book! I believe @carols10cents and I were going to go over all of the error messages at the very end and make sure they're up to date, but I also don't see the harm in merging this right now. Carol, whatcha think? |
I'm confused about this part? What do you mean by this? The version of Rust that you're using should be exactly what |
Aside from that, the book's error messages are out of date and I'm slowly updating them to be the ones generated by rustc 1.21.0. I thought I did chapter 2 recently, checking... |
Ok yeah I updated this recently with rustc 1.21.0. When I run this code:
I get this output:
and that's what we're going for in the book. We're going to have a notice in Chapter 1 (we're revising that chapter last) that we've used Rust 1.21.0 for all the examples in the book and that the exact output you see might be slightly different, but everything that compiles in the book should continue to compile with future versions (and since we've been working on this book for a while, with past versions even though that's not a guarantee of Rust's per se). Please let us know if you need any help getting the right Rust version, I'm still confused about what you mean by "rust 1.21.0 (rustc 1.18.0)" but if there's an upgrading problem we can help fix we'd be happy to help! |
thanks @carols10cents and @steveklabnik I'm confused by the version mismatch too. If it's not an expected situation, then there's probably something wrong with the setup on my Mac.
Maybe I should try uninstalling Rust entirely and reinstalling from scratch. |
Yeah I highly recommend using rustup rather than homebrew for managing Rust versions. I know, I know, it's another tool, but rustup Just Works for me and manages a lot of other aspects of your Rust dev setup. |
It sounds to me like you have both brew and rustup trying to manage a rust, and they're getting crossed. |
@steveklabnik Yup, that appears to be the case, with rustup taking precedence over Homebrew, so I was using an older version than I thought. @carols10cents Thanks for pointing out the issue and encouraging me to switch to just rustup. Appreciate it! Also thanks for caring about the small details, like the error messages shown in the book. |
When running
cargo build
with rust 1.21.0 (rustc 1.18.0), the warning appears as:rather than