Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mocking generic methods with lifetime parameters #48

Merged
merged 3 commits into from
Sep 5, 2019

Conversation

asomers
Copy link
Owner

@asomers asomers commented Sep 3, 2019

Now it's possible to mock generic methods with lifetime parameters, as long as they don't also have type parameters, and their return values are 'static or have the same lifetime as self.

@michaelmarconi does this work for you?

Wrapping a Fragile<FnMut<...>> in a closure causes problems with HRTBs,
because those can't be set using closure syntax
generic methods can now be mocked if they have lifetime parameters or
type parameters, but not both.
@michaelmarconi
Copy link

@asomers, that looks like a nicer solution than conditional code compilation!

@asomers
Copy link
Owner Author

asomers commented Sep 5, 2019

Thanks for your review, and happy hacking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants