hey all.
I have an object trait that lets me box up structure that implement related but non interacting traits.
That object traits let me take boxed dyn traits (which themselves implement object) and call an as_<trait>() -> Option<&'a dyn <trait>> function to get references
now I have some other structs that I want to create from one of these references
pub type StructureRef<'a, T: Object> = &'a dyn Structure<ID = <T as Object>::ID>;
// ...
impl<'a, T: Object> From<StructureRef<'a, T>> for StructureInfo {
fn from(value: StructureRef<'a, T>) -> Self {
// ...
}
}
however rustc complains with
the type parameter `T` is not constrained by the impl trait, self type, or predicates
unconstrained type parameter
but I can't figure out how this could be true. how could T be unconstrained?
is StructureRef<'a, T> not district for every T? meaning From<StructureRef<'a T>> should be too?