我的项目在其他机器上可以正常编译,但是在新的具有新的rustup的机器上,我得到了错误
$ cargo build
Updating crates.io index
error: failed to select a version for the requirement `rustc_version = "^0.1"`
candidate versions found which didn't match: 0.3.3, 0.3.2, 0.3.1, ...
location searched: crates.io index
这对我来说毫无意义。为什么0.3不匹配^ 0.1?
最佳答案
0.2之前的rustc_version
crate 的所有版本均为yanked。那和cargo considers changes to the minor before 1.0 to be incompatible。
如果rustc_version
文件中的0.2版之前的版本Cargo.lock
或已被下载并缓存,则它可能在其他计算机上工作。
关于rust - cargo 未能为rustc_version选择版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66333624/