由于解析器默认,货物穿梭运行失败

问题描述 投票:0回答:1

在我的项目目录中运行

cargo shuttle run
时, 我收到以下错误消息

warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
rust rust-cargo shuttle
1个回答
1
投票

这是一个使用“货物工作区”功能的项目。解决方案是在根目录的 Cargo.toml. 中定义解析器 [workspaces] resolver = "2"

对于 
Rust 2021 版

,首选方法是在 Cargo.toml 中声明版本。对于 Rust 2021,解析器默认为 2。 edition = "2021"

© www.soinside.com 2019 - 2024. All rights reserved.