我正在尝试在我的 Rust 项目中使用 crate 'num'(我完全是这种语言的新手),所以我的 Cargo.toml 现在是:
[package]
name = "hello_world"
version = "0.0.1"
authors = [ "Vini" ]
[dependencies]
time = "*"
num = "*"
但是当我运行时:
cargo run
我得到这个编译错误:
/.cargo/registry/src/github.com-0a35038f75765ae4/num-0.0.6/src/bigint.rs:66:16: 66:19 error: expected identifier, found keyword `mod`
/.cargo/registry/src/github.com-0a35038f75765ae4/num-0.0.6/src/bigint.rs:66 use std::str::{mod, FromStr};
^~~
/.cargo/registry/src/github.com-0a35038f75765ae4/num-0.0.6/src/bigint.rs:80:27: 80:28 error: expected one of `(`, `+`, `::`, `;`, `<`, or `]`, found `,`
/.cargo/registry/src/github.com-0a35038f75765ae4/num-0.0.6/src/bigint.rs:80 static ZERO_VEC: [BigDigit, ..1] = [ZERO_BIG_DIGIT];
^
Could not compile `num`.
我不知道这实际上意味着什么,我是不是用错了货物?这个版本的 'num' 与 cargo 不兼容吗?
我有货运版本:
cargo 0.4.0-nightly (15b497b 2015-07-08) (built 2015-07-10)
和锈编译器:
rustc 1.2.0 (082e47636 2015-08-03)