4 type Size: Add<Output = Self::Size>;
6 fn foo(&self) -> Self::Size;
9 pub trait SubEncoder: Encoder {
12 fn bar(&self) -> Self::Size;
19 type Size = <Self as SubEncoder>::ActualSize;
20 //~^ ERROR: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
22 fn foo(&self) -> Self::Size {
23 self.bar() + self.bar()
27 pub struct UnitEncoder;
29 impl SubEncoder for UnitEncoder {
35 pub fn fun<R: Encoder>(encoder: &R) {