From fce4c49d3a55bca492e99138d14e2a2168e46f95 Mon Sep 17 00:00:00 2001 From: pointer-to-bios Date: Thu, 18 Apr 2024 16:07:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9vscode=20rust-analyz?= =?UTF-8?q?er=E8=AF=AF=E6=8A=A5=E9=94=99=E8=AF=AF=E7=9A=84=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/contribution.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/contribution.md b/docs/contribution.md index e66325d..b9d3015 100644 --- a/docs/contribution.md +++ b/docs/contribution.md @@ -12,6 +12,22 @@ 若你的代码通过审核,将会把你的PR合并到主分支中。 +## 开发引导 + +## vscode + +vscode下的`rust-analyzer`插件会在`src/lib.rs`中误报`can't find crate for test`,实际上在`Cargo.toml`中已经增加了`test = false`选项。 + +解决方法是在`.vscode/settings.json`中增加两项: + +```json +"rust-analyzer.cargo.allTargets": false, +"rust-analyzer.cargo.extraArgs": [ + "--target", + "开发的目标平台的unknown-none类型目标(如x86_64-unknown-none)" +] +``` + ## 需要注意的还未解决的问题 * rust中所有有关字符串格式化的宏中,出现超过一个不止是`{}`的格式化占位符时内核必然崩溃。