Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Can't find crate for `std`" — compiler error with trivial code

Tags:

rust

I just updated to latest nightly of rust:

> rustc --version
rustc 0.11.0-pre-nightly (05ca9f7 2014-06-24 22:06:48 +0000)
host: x86_64-apple-darwin

After that even the trivial program doesn't compile with the following error:

> cat main.rs

fn main() {
    print!("Hello world");
}%   

> rustc main.rs 
main.rs:1:1: 1:1 error: can't find crate for `std`
main.rs:1 // Playground
          ^
error: aborting due to previous error

Is it some compiler bug in nightly or I didn't grasp some core idea in the language?

like image 341
Artem Abramov Avatar asked Jun 25 '14 19:06

Artem Abramov


1 Answers

It turned out that if you're upgrading from "semi-stable" version installed with Homebrew, you should first uninstall homebrew version, and only after that install nightly.

Otherwise you'll face the problems that are described in question: missing system libraries, etc, as rust libraries doesn't use versioning and located in the same place.

like image 102
Artem Abramov Avatar answered Sep 21 '22 06:09

Artem Abramov