tailhook / rust-argparse

The command-line argument parser library for rust
MIT License
240 stars 39 forks source link

Rust 1.2.0 unresolved import `std::process::exit()` #27

Closed CtrlC-Root closed 9 years ago

CtrlC-Root commented 9 years ago

I tried recently tried to build one of my projects which uses this library with rust 1.2.0 and ran into this compile error.

alexbarbur@hammond ~/p/rust-euler> cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading argparse v0.2.0
   Compiling argparse v0.2.0
/Users/alexbarbur/.cargo/registry/src/github.com-1ecc6299db9ec823/argparse-0.2.0/src/parser.rs:13:5: 13:23 error: unresolved import `std::process::exit`. There is no `exit` in `std::process`
/Users/alexbarbur/.cargo/registry/src/github.com-1ecc6299db9ec823/argparse-0.2.0/src/parser.rs:13 use std::process::exit;
                                                                                                      ^~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `argparse`.

To learn more, run the command again with --verbose.

You can reproduce it like so:

$ git clone https://github.com/CtrlC-Root/rust-euler.git
$ cd rust-euler
$ cargo build

I've been googling this for a while now and I can't seem to figure out if std::process::exit is deprecated or if there's something wrong with the version of rust I'm using. Any ideas?

tailhook commented 9 years ago

I use rust 1.2 every day, and exit function is not deprecated. Try:

rustc --version
CtrlC-Root commented 9 years ago

Wow, ok yeah, that was my bad. I guess the packaged version of rust is just way out of date.

screen shot 2015-09-08 at 2 56 08 pm