3

I'm using the Rust 0.6 compiler for mingw32. I'm able to compile small programs that import from "core", but not from "std". Here is a transcript showing a trivial example and how I am compiling it:

$ cat prog.rs
use std;
$ rustc.exe prog.rs
error: failed to resolve imports
prog.rs:1:4: 1:8 error: unresolved import
prog.rs:1 use std;
              ^~~~
error: aborting due to 2 previous errors

How do I get rustc.exe to resolve the import?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Arch D. Robison
  • 3,829
  • 2
  • 16
  • 26

1 Answers1

4

You first need to load the external crate via extern mod std;, and then you can use modules within that crate, or just use them directly qualified by std, e.g.

extern mod std;
use std::bigint;

fn main () {
    bigint::BigInt::from_uint(1);
    std::semver::parse("1.2.3-alpha1");
}

There is more information here.

huon
  • 94,605
  • 21
  • 231
  • 225