Rust My Cargo.toml显示一些红线,错误为';t编译serde_导出

Rust My Cargo.toml显示一些红线,错误为';t编译serde_导出,rust,rust-cargo,Rust,Rust Cargo,最近我尝试使用rust lang构建一个项目(这是我的第一个rust项目,我的老板支持我在公司使用一项新技术)。但是,我的货物上突然出现了一些红线。汤姆: 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

最近我尝试使用rust lang构建一个项目(这是我的第一个rust项目,我的老板支持我在公司使用一项新技术)。但是,我的货物上突然出现了一些红线。汤姆:

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代码1.43版本

这是我的货物。汤姆:

[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"
由于这是一个RLS(rust language server)错误[显然已关闭,请参阅],因此可以使用
rust analyzer
扩展[网站]作为临时替代

要安装扩展,您可以启动VSCode,单击左侧的
Extensions
选项卡,然后在市场中搜索
rust analyzer

请注意,如网站[截至2020年1月4日]所述,该项目仍处于ALPHA,这意味着它可能会出现故障


运行
cargo build
是否会出现任何错误?错误消息显示:
要了解更多信息,请使用--verbose再次运行该命令。
执行该操作时发生了什么?+1:对于简单的示例,也会发生这种情况:
cargo.toml
文件因鼠标悬停而变为红色提示:无法编译
serde\u-deriver
。但是:cargo run可以正常工作:输出:
serialized={“x”:1,“y”:2}
由于
cargo run
可以工作,我认为这可能是
rls
错误。当我使用--verbose运行代码时,它会显示相同的错误(那些错误)。但如果我运行货物或货物构建,一切都正常运行,但这些红线阻止我从另一个代码中获得另一个错误。如果是rls错误,除了官方代码外,vs代码是否有rls扩展?