Lsp rust-analyzer failed to run build scripts in nvim

Hello, I install rust-analyzer via pacman and also via official git rep, this one: User Manual, so, when I open any rust files, I got error, that fail to run build scripts

I install it via vim plug, settings:

local servers = { 'pyright', 'rust_analyzer' }
for _, lsp in ipairs(servers) do
  nvim_lsp[lsp].setup {
    settings = {
            ["rust_analyzer"] = {
                    cargo = {
                         checkOnSave = false,   
    on_attach = on_attach,
    flags = {
      debounce_text_changes = 150,

Are you using lspconfig? If so, what is the output of the command :LspInfo?

this one

I also started get this error(

Update: 20.08.2022, every new project, I got this error...

Same issue. I'll update here if I find a solution.

1 Like

I just got the same error and frequently run into this after updating rust-analyzer.
Running cargo clean usually fixes the issue for me and did in this case.

1 Like

Yeah I also fixed it, but now don't remember what exactly I did, maybe cargo clean help me

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.