RFC: goto-definition between From::from
and Into::into
Β #18316
Open
Description
opened on Oct 17, 2024
Currently if we trigger goto defintion here;
struct Foo;
fn foo() -> Foo {
struct Bar;
impl From<Bar> for Foo {
fn from(_: Bar) -> Self {
Foo
}
}
Bar.into$0()
}
it just takes us to std::convert::Into<T>::into
, because we do not have manual implementation of impl Into<Foo> for Bar
here.
I think that it would be reasonable to provide two definition sources, std::convert::Into<T>::into(..)
with the above fn from(..)
inside the impl From<Bar> for Foo { .. }
block as well, and implement similar thing to the opposite direction from(..)
-> into(..)
.
Activity