Consider this contrived example
enum Result<T, E>
where
T: Into<Option<()>>,
E: Into<Option<()>>
{
Ok(T),
Err(E)
}
trait Generic<T, E>
where
T: Into<Option<()>>,
E: Into<Option<()>>
{
fn generic (&self) -> Result<T, E>;
}
trait GetResult {
fn getResult (&self) -> Option<()>;
}
impl<T, E, G, U> GetResult for (G, Option<()>)
where G: Generic<T, E>
{
fn getResult (&self) -> Option<()> {
self.0.into()
}
}
really straightforward i want to the trait implementations of Generic
to be able to return a type than can be converted into Option<()>
rather than Option<()>
itself and i need to use that trait in another trait implementation.
but i get
Error[E0207]: the type parameter `E` is not constrained by the impl trait, self type, or predicates
--> src/main.rs:22:9
|```