尝试编译:https://github.com/SergioBenitez/Rocket/tree/master/examples/hello
Cargo.toml
[dependencies]
rocket = "0.4.10"
Run Code Online (Sandbox Code Playgroud)
抱怨我每晚都需要 Rust
$ cargo build
...
Error: Rocket (core) requires a more recent version of rustc.
Installed version: 1.54.0 (2021-05-17)
Minimum required: 1.54.0-nightly (2021-05-18)
Run Code Online (Sandbox Code Playgroud)
我已经完成了本地目录覆盖
$ rustup override set nightly
Run Code Online (Sandbox Code Playgroud)
我每晚运行 2021-05-17 但我需要 2021-05-18
$ rustup show
...
active toolchain
----------------
nightly-x86_64-unknown-linux-gnu (directory override for '/<redacted>')
rustc 1.54.0-nightly (3e99439f4 2021-05-17)
Run Code Online (Sandbox Code Playgroud)
我尝试了各种命令来获取更新的每晚
$ rustup update
$ rustup update nightly
$ rustup toolchain install nightly-2021-05-18
Run Code Online (Sandbox Code Playgroud)
当我这样做的时候,会发生一些奇怪的事情rustup update nightly
$ rustup update nightly
info: syncing …Run Code Online (Sandbox Code Playgroud) 在处理具有 ARM 目标的项目时,RLS 给出以下错误消息:
E0463:找不到板条箱,因为
test找不到板条箱
再生产:
cargo new --bin app
cd app
mkdir .cargo
echo '[build]' > .cargo/config
echo 'target = "thumbv7m-none-eabi"' >> .cargo/config
echo '#![no_std]' > src/main.rs
rls --cli
Run Code Online (Sandbox Code Playgroud)
我相信这是因为 ARM 目标没有测试箱。
有没有办法避免这个错误?
E0463 上还有其他几个 SO 帖子,但似乎这些都是配置错误。以上纯粹是RLS问题。它导致我的编辑器显示错误并且代码不完整等。
我正在尝试弄清楚如何使用 WSL 中的 rustc 和 cargo。我使用 VS Code 和 Rust (rls) 插件并且可以编译我的代码,但是 RLS 存在问题:
无法启动客户端 Rust 语言服务器
Rustup 不可用。从https://www.rustup.rs/安装
我该如何解决这个问题?
rust visual-studio-code windows-subsystem-for-linux rust-language-server
我通过rustup update最近升级了Rust环境,然后每次打开编辑器时VSCode都会报告错误。编辑器的右下角会弹出两个重复的窗口,显示
Duplicated RLS configuration: rustfmt_path:rustfmt_path,rustfmt_path,,
Source: Rust (rls) (Extension)
Run Code Online (Sandbox Code Playgroud)
我可以打开VSCode的默认settings.json并确实找到重复的条目,但无法删除它们。
重新启动扩展程序可以重现该问题,我什至不知道插件本身是否正常工作。
我已经安装了 Eclipse for Rust,并想使用它进行开发。然而,RLS 的内容辅助(例如代码完成和突出显示)\xe2\x80\x99 不起作用。RLS 似乎找不到racer或rustc。
当我查看 Rust 的设置(窗口 > 首选项 > Rust)时,我注意到 RLS 配置指向 ~/.cargo/rls.conf 中不存在的文件。这是一个问题吗?如果是这样,我该如何修复它?如果不是,我可以采取哪些步骤来排除 RLS 故障?
\n\n我目前使用 Ubuntu 18.04 和 Eclipse Photon。
\n我尝试通过命令构建rlscargo +nightly build --release -Z unstable-options,但出现以下错误:
error[E0599]: no method named `expect_none` found for enum `Option<Fingerprint>` in the current scope
--> /Users/cjw/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-ap-rustc_span-705.0.0/src/lib.rs:2003:48
|
2003 | cache[index].replace(sub_hash).expect_none("Cache slot was filled");
| ^^^^^^^^^^^ method not found in `Option<Fingerprint>`
Run Code Online (Sandbox Code Playgroud)
经过搜索,我发现这expect_none是一个夜间功能,似乎已被删除。
所以我想也许我应该更改 rust 编译器版本来解决编译问题。如果这是正确的解决方案,我该怎么做?有人可以提供一些详细的建议吗?