Skip to content

request handler panicked: cannot find !BoundConst { var: 0 } #21173

@NobodyNada

Description

@NobodyNada

rust-analyzer version: 2025-11-24 and later, latest nightly, and master

rustc version: rustc 1.93.0-nightly (cc3eee7fb 2025-11-28)

editor or extension: Neovim

relevant settings: I don't think any of these are relevant, but here's my config:

{
    checkOnSave = true,
    check = {
        allTargets = true,
        command = "clippy"
    },
}

code snippet to reproduce:

pub trait Tr {
    type Assoc;

    fn f(&self, handle: Self::Assoc);
}

pub struct ConstGeneric<const N: usize>;

impl<const N: usize> Tr for &ConstGeneric<N> {
    type Assoc = AssocTy;

    fn f(&self, a: Self::Assoc) {
        a.x
        
    }
}

pub struct AssocTy {
    x: (),
}

Making any edit at all to the above code (including a whitespace change) results in the following error:

rust-analyzer: -32603: request handler panicked: cannot find `!BoundConst { var: 0 }` in param-env: ParamEnv {                 
    clauses: [],                                                                                                               
}

A git bisect points to 3f0a563 (#20974) as the first commit with the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bugE-has-instructionsIssue has some instructions and pointers to code to get started

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions