You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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(..).
The text was updated successfully, but these errors were encountered:
Those would be the ideal solution, but assuming this special case isn't much work to implement I think it would be fine for us to special case From/Into here? For the time being at least, as those issues seem a fair bit more complicated to pull off to me
I'm asking this just out of curiosity 😅
I think that solving monomorphization in #15315 is preferable but could "skipping generic intermediates" in general without hard-coding for each well known traits be possible?
I think that the relationship between such "dual" traits are not so much clear in code.
Though Into's blanket implementation calls from(..) inside into(..) method but concluding such "dual" relationship from such calls inside blanket implementation's method body seems quite arbitrary, without our common sense that they are "dual".
Currently if we trigger goto defintion here;
it just takes us to
std::convert::Into<T>::into
, because we do not have manual implementation ofimpl Into<Foo> for Bar
here.I think that it would be reasonable to provide two definition sources,
std::convert::Into<T>::into(..)
with the abovefn from(..)
inside theimpl From<Bar> for Foo { .. }
block as well, and implement similar thing to the opposite directionfrom(..)
->into(..)
.The text was updated successfully, but these errors were encountered: