【发布时间】:2015-12-13 19:04:21
【问题描述】:
我正在尝试在我的 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)
和 rust 编译器:
rustc 1.2.0 (082e47636 2015-08-03)
【问题讨论】:
-
我已经在帖子中添加了信息,感谢您的关注!
-
感谢@Shepmaster!再次构建 Cargo.lock 解决了这个问题,旧版本中“num”的引用确实是旧版本。
标签: compiler-errors rust rust-cargo