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 methods with lifetime parameters of generic structs #226

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

asomers
Copy link
Owner

@asomers asomers commented Nov 3, 2020

For example, generic structs implementing Future. The method must not be treated as a generic method, since it has a non-static argument.

Issue #223

For example, generic structs implementing Future.  The method must not
be treated as a generic method, since it has a non-static argument.

Issue #223
This can happen with automock when the impl block has where clauses that
apply to some methods, but not others.
@asomers asomers merged commit 2a29a5e into master Nov 3, 2020
@asomers asomers deleted the mock_future branch November 3, 2020 05:00
asomers added a commit that referenced this pull request Nov 3, 2020
It turns out that it wasn't necessary.  PR #225 was sufficient to fix
the issue.  And #226 is awkward, because it can result in the expect_
methods having fewer generic parameters than the original methods.
Worse, sometimes mockall will generate code that fails to compile,
because the Where clauses reference generic parameters that aren't
there.
@asomers asomers mentioned this pull request Nov 3, 2020
asomers added a commit that referenced this pull request Nov 3, 2020
It turns out that it wasn't necessary.  PR #225 was sufficient to fix
the issue.  And #226 is awkward, because it can result in the expect_
methods having fewer generic parameters than the original methods.
Worse, sometimes mockall will generate code that fails to compile,
because the Where clauses reference generic parameters that aren't
there.
asomers added a commit that referenced this pull request Nov 4, 2020
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