Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Base {
- type Item;
- type Item2;
- }
- trait Service {
- type R;
- type E;
- type C: Base<Item = Self::R, Item2 = Self::E>;
- }
- struct Inner<T: Service> {
- service: T,
- }
- struct S1<T: Service> {
- inner: Inner<T>,
- }
- struct S2 {
- inner: Inner<ServiceImpl>,
- }
- struct BaseImpl {}
- impl Base for BaseImpl {
- type Item = u64;
- type Item2 = String;
- }
- struct ServiceImpl {}
- impl Service for ServiceImpl {
- type R = u64;
- type E = String;
- type C = BaseImpl;
- }
- fn create() -> ServiceImpl { // хз что тут должно быть
- panic!()
- }
- fn main() {
- let a = S2 { inner: create() };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement