我想通过Cargo运行一个示例,但是遇到了错误:
error: failed to parse manifest at `/Users/aviralsrivastava/dev/subxt/Cargo.toml`
完整的堆栈跟踪信息为:
error: failed to parse manifest at `/Users/aviralsrivastava/dev/subxt/Cargo.toml`
Caused by:
feature `edition2021` is required
The package requires the Cargo feature called `edition2021`, but that feature is not stabilized in this version of Cargo (1.56.0-nightly (b51439fd8 2021-08-09)).
Consider adding `cargo-features = ["edition2021"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2021 for more information about the status of this feature.
根据建议,我继续修改Cargo.toml:
Consider adding `cargo-features = ["edition2021"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
diff --git a/Cargo.toml b/Cargo.toml
index 26a02c7..186d09b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[workspace]
members = [".", "cli", "codegen", "macro"]
-
+cargo-features = ["edition2021"]
[package]
name = "subxt"
version = "0.15.0"
(END)
即使在toml文件中没有改变任何内容,我仍然面临相同的错误。
如何解决上述错误以使用不稳定的软件包?
rustup default nightly && rustup update
呢? 我克隆了 subxt 存储库,对我来说运行良好。 - AurevoirXavier