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

Add support for mocking associated consts #187

Merged
merged 1 commit into from
Aug 29, 2020
Merged

Conversation

asomers
Copy link
Owner

@asomers asomers commented Aug 29, 2020

automock can now mock a trait impl with an associated const. It can't
mock the trait declaration, because in that case there's no way to set
the value of the associated const on the mock struct. Of course, if the
trait itself has a default value for the const, then automock will work.
automock can now mock a struct impl with an associated const.

mock! can now mock structs with both inherent associated consts, and
associated consts on their trait impls.

Fixes #97

automock can now mock a trait impl with an associated const.  It can't
mock the trait declaration, because in that case there's no way to set
the value of the associated const on the mock struct.  Of course, if the
trait itself has a default value for the const, then automock will work.
automock can now mock a struct impl with an associated const.

mock! can now mock structs with both inherent associated consts, and
associated consts on their trait impls.

Fixes #97
@asomers asomers merged commit 64eeb5b into master Aug 29, 2020
@asomers asomers deleted the associated_const branch August 29, 2020 17:06
asomers added a commit that referenced this pull request Sep 7, 2020
asomers added a commit that referenced this pull request Sep 7, 2020
Improve an error message from PR #187
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.

Support for trait's associated const
1 participant