You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行cargo shuttle run失败:resolver版本与虚拟工作区默认值冲突

解决Cargo Shuttle运行时Resolver版本不一致问题

执行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

解决步骤:

  • 打开项目工作区根目录下的Cargo.toml文件
  • 根据需求选择以下配置之一添加到文件中:
    • 若要保留旧版依赖解析逻辑(resolver 1),添加或修改[workspace]区块:
      [workspace]
      resolver = "1"
      
    • 若要使用2021 Edition默认的新版依赖解析逻辑(resolver 2,推荐),添加或修改[workspace]区块:
      [workspace]
      resolver = "2"
      
  • 保存文件后,重新执行cargo shuttle run即可。

内容的提问来源于stack exchange,提问作者Matilda Smeds

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 06:47:02