rust-lang / rust-lang/rust-analyzer

Const generic param unknown type

Open
#20,294 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: rust-analyzer 1.90.0-nightly (9748d87 2025-07-21)

rustc version: rustc 1.90.0-nightly (9748d87dc 2025-07-21)

editor or extension: VIM-9.1 coc-rust-analyzer

code snippet to reproduce:

fn foo<const N: usize>() {}

fn main() {
    foo::<3usize>();
}

Hover on 3usize output {unknown}

Image

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

Reproduce the issue with the Rust snippet and inspect the hover handling for the const argument 3usize. Trace why the hover displays {unknown}; the work is done when the hover reports the const argument's type correctly for this example.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.