【发布时间】:2022-08-21 02:51:04
【问题描述】:
我正在尝试在 rust 中运行一个项目。我一直遇到这个 2021 版错误:
% rustc --version
rustc 1.60.0-nightly (a7e2e3396 2022-01-08)
我跑了这一切:
If you are trying to migrate from the previous edition (2018), the
process requires following these steps:
1. Start with edition = \"2018\" in Cargo.toml
2. Run cargo fix --edition
3. Modify Cargo.toml to set edition = \"2021\"
4. Run cargo build or cargo test to verify the fixes worked
我不断收到此错误:
Failed to obtain package metadata: Error during execution of cargo metadata: error: failed to parse manifest at /workdir/program/Cargo.toml
Caused by:
the cargo feature edition2021 requires a nightly version of Cargo, but this is the stable channel
我在这里完全不知所措。我发现了很多相互矛盾的信息。我已经更改了目录,在 SO 上找到了这样的答案:Unable to specify `edition2021` in order to use unstable packages in Rust
我在这里完全不知所措。我在这里缺少的步骤是什么?我在 MacOS Big Sur 上。
-
看起来您正在运行稳定的 Cargo,但每晚都运行 rustc。输入
cargo --version的结果是什么? -
@ChayimFriedman cargo 1.60.0-nightly (358e79fe5 2022-01-04)
-
你解决了吗?
标签: rust rust-cargo