rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

hover over associated functions should show the impl block they are defined in

Open veber-alex opened this issue 2 years ago • 1 comments

consider this code:

struct Foo<T>(T);

impl<T: Eq> Foo<T> {
    fn new(t: T) -> Self {
        Self(t)
    }
}

fn main() {
    let foo = Foo::new(1.2);
}

This doesn't compile because f64 doesn't implement Eq, however the hover and popup that shows for new has no mention of the bound T: Eq from the impl block. It just shows:

playground::Foo
fn new(t: T) -> Self

I think it should also show the impl block definition, as that is an integral part of the functions signature:

playground::Foo
impl<T: Eq> Foo<T>
fn new(t: T) -> Self

veber-alex avatar Jul 31 '22 20:07 veber-alex

Interested in giving this a shot

macovedj avatar Aug 01 '22 16:08 macovedj