rust-lang / rust-lang/rust-analyzer

ICE: "mut #0 has parameters, but no args were provided in instantiate" panic on completion popup with Arc<Mutex<T>>

Open
#22,926 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-panic
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version
rust-analyzer 1.97.1 (8bab26f 2026-07-14)

rustc version
rustc 1.97.1 (8bab26f4f 2026-07-14)

editor or extension
Neovim

code snippet to reproduce:

use std::{
    sync::{Arc, Mutex},
    thread::{self, JoinHandle},
    time::Duration,
};

fn main() {
    let counter = Arc::new(Mutex::new(0));
    let mut handles: Vec<JoinHandle<()>> = vec![];

    for _ in 0..=10 {
        let counter = Arc::clone(&counter);
        let handle = thread::spawn(move || {
            let mut num = counter.lock().unwrap();
            *num += 1;
        });
        handles.push(handle);
    }

    for handle in handles {
        handle.join().unwrap();
        // println!("handle lengt: {}", handles.len());
        thread::sleep(Duration::from_millis(500));
    }

    println!("Result: {}", *counter.lock().unwrap());
}

summary
rust-analyzer panics with the error whenever the completion/signature popup
appears while typing in a function that uses Arc<Mutex<T>> across threads:

https://github.com/user-attachments/assets/47cf0a39-77dc-48fd-88c3-e3ce2e42077a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names the completion/signature popup as the failing entry point and provides a Rust reproducer for Neovim. First reproduce the panic with the supplied Arc<Mutex> snippet, then trace completion handling around the reported instantiate error. Done means the popup no longer panics for this code and the regression is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
neovim, rust
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.