audunhalland / unimock

A versatile and developer-friendly trait mocking library
MIT License
71 stars 3 forks source link

Cannot use arbitrary self types with the default function impls #26

Closed audunhalland closed 1 year ago

audunhalland commented 1 year ago

There is currently a compile error when trying to use this.

e.g.

    #[unimock(api = DefaultBodyMock)]
    trait DefaultBody: Sized {
        fn core(self: Rc<Self>, arg: i32) -> i32;

        fn default_body(self: Rc<Self>, arg: i32) -> i32 {
            self.core(arg * 2)
        }
    }

does not work.

There's a fix in the pipeline.