gpt4 book ai didi

rust - 我的 Cargo.toml 显示一些红线,错误无法编译 serde_derive

转载 作者:行者123 更新时间:2023-12-03 11:25:17 24 4
gpt4 key购买 nike

最近尝试用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 代码 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"

最佳答案

由于这是一个 RLS(rust 语言服务器)错误 [显然已关闭,请参阅 here ],临时替代方案可以使用 rust-analyzer分机【网站here ]。
要安装扩展,您可以启动 VSCode,单击 Extensions选项卡并搜索 rust-analyzer在市场中。

Please note that as mentioned on the website [as of 04/01/2020], this project is still in ALPHA, which means it may be prone to breakages.

关于rust - 我的 Cargo.toml 显示一些红线,错误无法编译 serde_derive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60681885/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com