rust - 我的 Cargo.toml 显示一些带有错误的红线无法编译 serde_derive
问题描述
我最近尝试使用 rust-lang 构建一个项目(这是我的第一个 rust 项目,我的老板支持我在公司使用新技术)。但是,我的 Cargo.toml 突然出现了一些红线:
could not compile `serde_derive`.
error: could not compile `async-trait`.
To learn more, run the command again with --verbose.
error: could not compile `rand_chacha`.
To learn more, run the command again with --verbose.
error: could not compile `proc-macro-hack`.
To learn more, run the command again with --verbose.
error: could not compile `diesel_derives`.
To learn more, run the command again with --verbose.
我运行命令 Cargo Run 并且我的项目运行良好,但是这些红线阻止我跟踪项目中其他代码的错误(因此,如果代码中有错误,它不会显示,因为仍然存在另一个文件中的一些错误,它是 Cargo.toml)
我正在使用 cargo 1.43.0-nightly (bda50510d 2020-03-02)、rustc 1.43.0-nightly (c20d7eecb 2020-03-11) 和 vs code 1.43 版本。
这是我的 Cargo.toml :
[package]
name = "app_base"
version = "0.1.0"
authors = ["yonathan"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = "0.4.3"
rocket_codegen = "0.4.3"
rocket_contrib = "0.4.3"
rocket_http = "0.4.3"
cookie = "0.11.2"
rocket-json-response = "0.5.10"
diesel = { version = "1.4.3", features = ["postgres"] }
dotenv = "0.15.0"
postgres = { version = "0.17.2", features = ["with-chrono-0_4"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
json-gettext = "3.1.7"
debug-helper = "0.3.8"
serializers = "0.2.3"
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
chrono = "0.4"
解决方案
推荐阅读
- algorithm - 是否有可能有两个依赖于不同变量的有效大 O 运行时?
- nunit - 使用 TestCaseSource 时的迭代次数
- python - 在 Python 中读取 SQL 表
- javascript - 复选框未在带有 javascript 消息的 Gridview 中触发
- java - 对象序列化时netty编解码器可以发送包吗
- azure - Azure 服务总线队列分区队列 AutoRenewTimeout
- neo4j - 将 Neo4j 2.3 升级到 3.4 - 无法访问 jarfile 2.x-config-migrator.jar
- go - 将密码从 []byte 转换为 string 时 go package wincred 添加空格
- java - Pattern.matcher() 究竟是如何工作的?
- ruby-on-rails - Rails - 将数据库信息更改为环境变量时出现迁移错误 - AWS