Rust Programming2026-02-27 01:00

rust-analyzer diagnostics disappear after indexing

rustfan
rustfan
Author

##Diagnostics from rust-analyzer disappear Diagnostics from cargo clippy display, but then disappear or change. When I restart rust-analyzer, clippy completes and I’ll see verbose diagnostics (this is good). After indexing completes, few diagnostics show and they are less verbose. In this example, the unused import and unused variable display after clippy is done. Then, they disappear and I only see “unused variable” after ‘indexing’ completes. (Sometimes all the diagnostics disappear) I expected to see the clippy diagnostics without it disappearing or changing. Is there a way to configure nvim/rustaceanvim/rust-analyzer or etc to display the diagnostics from clippy? Is this a bug in rustaceanvim, rust-analyzer, or something else? gif:

running rust analyzer
after clippy:
after clippy
after indexing:
after indexing
###how to Basically:

  • install rust-analyzer 2026-02-24 directly from the github page
  • create a new project
    • cargo new myproject

  • add something that would show a warning

    • let unused_var = 0;

  • run nvim with the minimal config

    • nvim -u minimal.lua src/main.rs

  • restart rustanalyzer

    • :RustAnalyzer restart.

I’m using rustaceanvim’s minimal config (with minor edit’s to see the analyzer working).

”` – minimal.lua – modified nvim config from rustaceanvim – see: https://github.com/mrcjkb/rustaceanvim/blob/master/troubleshooting/minimal.lua – turned on diagnostics – display lsp state in bottom right corner – add rustanalyzer settings

vim.diagnostic.config({

virtual_text = true, -- show inline messages
signs = true, -- show signs in the gutter
underline = true, -- underline problematic text
update_in_insert = false, -- don't update diagnostics while typing
severity_sort = true, -- sort diagnostics by severity

}

50

Comments (0)

Login to comment

Login Now

Loading comments...