rust - Rocket Framework 示例无法编译
问题描述
我尝试每晚安装 Rust 并编译 Rocket 的 hello_world 示例项目。我收到了这个错误:
error[E0599]: no associated item named `Lifetime`
error[E0599]: no associated item named `Lifetime` found for type `syntax::ast::GenericParam` in the current scope
--> /Users/azwar/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_codegen-0.3.13/src/decorators/derive_form.rs:30:25
|
30 | GenericParam::Lifetime(ref def) => Some(def),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated item not found in `syntax::ast::GenericParam`
我搜索了这个错误,但没有解释如何修复该错误的线程或文章。
这些是我的依赖项:
[dependencies]
rocket = "0.3.13"
rocket_codegen = "0.3.13"
我正在使用生锈rust version 1.28.0-nightly (cbc4c8380 2018-06-22)
解决方案
您的问题已在 v0.3.14 中得到解决。
将您的更新Cargo.toml
为"0.3.14"
. cargo update
然后使用或直接指定包更新您的板条箱:
cargo update -p rocket_codegen
cargo update -p rocket
推荐阅读
- javascript - 如何在jQuery中动画后删除元素?
- html - 为什么将窗口大小的画布元素从内联更改为块删除滚动条?
- vue.js - vue-testing-library 出现“vue-cli-service 未被识别为内部或外部命令”错误
- c - _mm_load_si128 以相反的顺序加载数据
- javascript - 为什么只执行最后一个输出语句?
- python - 函数声明中的 Python TypeError
- php - 将 htmlspecialchars_decode 与 PDO 一起用于编辑表单?
- python - Python 3.9 找不到 Python pip 模块“没有名为‘...’的模块”
- php - Lumen 8 依赖注入 - 无法解析的依赖解析 [参数 #0 [
$app ]] 在类 Illuminate\Support\ServiceProvider - python - 如何修复 ValueError:输入形状在 python 中不与栅格重叠?