| 1 | struct StructWithDefaultTypeParamDiff<'__daft, T: Diffable + '__daft = ()> { |
| 2 | field: <T as ::daft::Diffable>::Diff<'__daft>, |
| 3 | } |
| 4 | impl<'__daft, T: Diffable + '__daft> ::core::fmt::Debug |
| 5 | for StructWithDefaultTypeParamDiff<'__daft, T> |
| 6 | where |
| 7 | <T as ::daft::Diffable>::Diff<'__daft>: ::core::fmt::Debug, |
| 8 | { |
| 9 | fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| 10 | f.debug_struct(stringify!(StructWithDefaultTypeParamDiff)) |
| 11 | .field(stringify!(field), &self.field) |
| 12 | .finish() |
| 13 | } |
| 14 | } |
| 15 | impl<'__daft, T: Diffable + '__daft> ::core::cmp::PartialEq |
| 16 | for StructWithDefaultTypeParamDiff<'__daft, T> |
| 17 | where |
| 18 | <T as ::daft::Diffable>::Diff<'__daft>: ::core::cmp::PartialEq, |
| 19 | { |
| 20 | fn eq(&self, other: &Self) -> bool { |
| 21 | self.field == other.field |
| 22 | } |
| 23 | } |
| 24 | impl<'__daft, T: Diffable + '__daft> ::core::cmp::Eq |
| 25 | for StructWithDefaultTypeParamDiff<'__daft, T> |
| 26 | where |
| 27 | <T as ::daft::Diffable>::Diff<'__daft>: ::core::cmp::Eq, |
| 28 | {} |
| 29 | impl<T: Diffable> ::daft::Diffable for StructWithDefaultTypeParam<T> { |
| 30 | type Diff<'__daft> = StructWithDefaultTypeParamDiff<'__daft, T> where Self: '__daft; |
| 31 | fn diff<'__daft>( |
| 32 | &'__daft self, |
| 33 | other: &'__daft Self, |
| 34 | ) -> StructWithDefaultTypeParamDiff<'__daft, T> { |
| 35 | Self::Diff { |
| 36 | field: ::daft::Diffable::diff(&self.field, &other.field), |
| 37 | } |
| 38 | } |
| 39 | } |