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
A lot of the possible impl surface of a trait can't be impld in today's Rust because of the restrictions placed on impls.
I think it would be useful to have a way to express if THIS impl doesn't match, try THAT impl, in a chain, like in PureScript: purescript/purescript#2315
E.g. in Rust:
impl<.. /* some bounds */> TraitforFoo{ ...}
else
impl<.. /* other bounds */> TraitforFoo{ ...}
else
impl ...
It could even be possible to specify else impls for impls defined in dependency crates, if we can refer to them by a name.
That would require named impls, which there is already some demand for:
This is a feature request to change the language and as such needs an RFC. I suggest you discuss this in the internals forum to figure out the caveats and then open an rfc
A lot of the possible
impl
surface of a trait can't beimpl
d in today's Rust because of the restrictions placed onimpl
s.I think it would be useful to have a way to express
if THIS impl doesn't match, try THAT impl
, in a chain, like in PureScript: purescript/purescript#2315E.g. in Rust:
It could even be possible to specify
else impl
s forimpl
s defined in dependency crates, if we can refer to them by a name.That would require named impls, which there is already some demand for:
rust-lang/rfcs#2251
https://internals.rust-lang.org/t/looking-for-rfc-coauthors-on-named-impls/6275
The text was updated successfully, but these errors were encountered: