trait TraitA {
fn name(&self) -> String;
}
trait TraitB {
fn hello(&self) -> String;
}
struct St<T>(T);
impl<T: TraitB> TraitB for St<T> {
fn hello(&self) -> String {
self.0.hello()
}
}
impl<T: TraitA> TraitB for St<T> {
fn hello(&self) -> String {
format!("hello, {}", self.0.name())
}
}
error[E0119]: conflicting implementations of trait pyo3::FromPyObject<'_>
for type ffi::py::serde::FromFfi<_>
I want to impl TraitB
for St<T>
, if T
had impl TraitA
and not impl TraitB
.