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

Fix setting expectations on barely-generic functions #272

Merged
merged 2 commits into from
Apr 19, 2021
Merged

Conversation

asomers
Copy link
Owner

@asomers asomers commented Apr 19, 2021

If the function's generic parameters appeared in neither input nor
return type, the Expectations object would not be parameterized on the
functions generic parameters.  This wasn't really by design; it was
actually an artifact of Mockall's second incarnation, which used a
macro_rules! macro to generate the mock objects.

Fixing the problem is easy.  It's a matter of removing the code that
tried to guess the generic parameters based on the functions arguments
and return types.

Fixes #269

If declosurefy removes all of a where clause's predicates, then it
should remove the whole where clause.  This results in some functions
will no longer need to use generic Expectations structs.
If the function's generic parameters appeared in neither input nor
return type, the Expectations object would not be parameterized on the
functions generic parameters.  This wasn't really by design; it was
actually an artifact of Mockall's second incarnation, which used a
macro_rules! macro to generate the mock objects.

Fixing the problem is easy.  It's a matter of removing the code that
tried to guess the generic parameters based on the functions arguments
and return types.

Fixes #269
@asomers asomers merged commit 50ba8e5 into master Apr 19, 2021
@asomers asomers deleted the issue_269 branch April 19, 2021 13:15
asomers added a commit that referenced this pull request Jul 10, 2021
PR #272 added support for specializing methods of generic structs, but
broke specializing methods of nongeneric structs.

Fixes #307
asomers added a commit that referenced this pull request Jul 10, 2021
PR #272 added support for specializing methods of generic structs, but
broke specializing methods of nongeneric structs.

Fixes #307
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.

1 participant