#![crate_type = "lib"] use std::ops::Mul; pub trait A {} pub trait B { type AT: A; } pub trait C { type BT: B; } pub struct AV; impl A for AV {} pub struct BV; impl B for BV { type AT = AV; } pub struct CV; impl C for CV { type BT = BV; } pub struct WrapperB(pub T); pub struct WrapperC(pub T); impl Mul::AT>> for WrapperC where C1: C { type Output = u8; fn mul(self, _: WrapperB<::AT>) -> Self::Output { loop {} } } impl Mul> for WrapperC { type Output = u8; fn mul(self, _: WrapperC) -> Self::Output { loop {} } }