Skip to content

Go to Definition doesn't pointed to correct implementation.  #14275

@nurmohammed840

Description

@nurmohammed840
struct Foo<const T: bool>;
impl Foo<true> {
    fn foo(self) {}  // <- Landed here
}
impl Foo<false> {
    fn foo(self) {}  // <- Expected to land here
}
fn main() {
    const B: bool = false;
    let foo: Foo<B> = Foo; 
    foo.foo();  //  Go to Definition of  `foo()`
}

When used with const variable as type. Foo<B>, It doesn't pointed to correct implementation.
But Foo<false> did pointed to the right implementation.

rust-analyzer version: 0.3.1426 (2023-03-05)
rustc version: 1.67.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions