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
Might be worth adding some sort of mechanism for applying a transition only for a certain set of the derived type generics OR some trait bounds (that would match the From impl affecting the derived type).
Example of the desired behavior:
#[derive(TransitiveFrom)]
#[transitive(into(B, C, D)] // only for A<u8>
#[transitive(into(E, F, G, H)] // only for A<T: AsRef<str>>
pub struct A<T>(T);
impl From<A<u8>> for B {...}
impl<T> From<A<T>> for E
where T: AsRef<str> {...}
Still no idea on what notation to use and how to organize this in the attribute.
Ideally, these constraints should be applied per transition path, as otherwise the same conflicts would arise as in previous versions.
Perhaps the attribute could be modified like this: #[transitive(into(path(B, C, D), generics(u8), bound("T: AsRef<str>"))]
Generics would get resolved in order if provided and any left overs, if any, would have to be constrained by the trait bounds if necessary.
"name = value" pairs might be a better idea though.
The text was updated successfully, but these errors were encountered:
Might be worth adding some sort of mechanism for applying a transition only for a certain set of the derived type generics OR some trait bounds (that would match the
From
impl affecting the derived type).Example of the desired behavior:
Still no idea on what notation to use and how to organize this in the attribute.
Ideally, these constraints should be applied per transition path, as otherwise the same conflicts would arise as in previous versions.
Perhaps the attribute could be modified like this:
#[transitive(into(path(B, C, D), generics(u8), bound("T: AsRef<str>"))]
Generics would get resolved in order if provided and any left overs, if any, would have to be constrained by the trait bounds if necessary.
"name = value" pairs might be a better idea though.
The text was updated successfully, but these errors were encountered: