我在Visual Studio Code上使用rust-analyzer版本0.2.408。 我正在编写一个命令行应用程序,它涉及到在终端中居中显示文本。但是rust-analyzer给出了一个错误,突出显示了从use语句中的tr};到return后面的p的所有内容:“无法解决宏$crate::format_args rust-analyzer(宏错误)VSCode将我链接到rust-analyzer user manual,它只显示“对于宏扩展错误显示此诊断”。重新启动VSCode和重新安装防锈分析仪没有任何作用。从这个
如下所示:#[tokio::main]这将像我所期望的那样编译和运行,但是VS代码的rust-analyzer错误信息是:
proc macro `main` not expanded: proc macro not found rust-analyzer (unresolved-proc-macro)
i32, i32> {}
let Ok(x) | Err(x) = foo(true); // rust-analyzertop-level or-patterns are not allowed in `let` bindings
if let Ok(x) | Err(x) = foo(true) { // rust-analyzer