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 some must_use warnings #37

Merged
merged 1 commit into from
Aug 29, 2019
Merged

Add some must_use warnings #37

merged 1 commit into from
Aug 29, 2019

Conversation

asomers
Copy link
Owner

@asomers asomers commented Aug 24, 2019

There's no good reason to create a Context object but not set any
expectations. And when the "nightly" feature is off, there's no good
reason to create an expectation but not set its return value. Warn the
user if he does one of those things.

Suggested by @ArekPiekarz

There's no good reason to create a Context object but not set any
expectations.  And when the "nightly" feature is off, there's no good
reason to create an expectation but not set its return value.  Warn the
user if he does one of those things.

Suggested by @ArekPiekarz
@asomers asomers merged commit e6c959d into master Aug 29, 2019
@asomers asomers deleted the must_use branch August 29, 2019 02:15
asomers added a commit that referenced this pull request Nov 2, 2019
Pull request #37 added some must_use warnings conditionalized on the
"nightly" feature.  However, because proc macros are unhygienic, the
warnings were actually conditionalized on the instantiating crate's
nightly feature, not on mockall_derive's nightly feature.  I didn't
notice at the time because Mockall _also_ has a nightly feature, and so
does the only crate of mine that uses Mockall.

Fix the hygiene errors, and rename mockall_derive's feature to
"nightly_derive", which will help to catch similar errors in the future.
asomers added a commit that referenced this pull request Nov 2, 2019
Pull request #37 added some must_use warnings conditionalized on the
"nightly" feature.  However, because proc macros are unhygienic, the
warnings were actually conditionalized on the instantiating crate's
nightly feature, not on mockall_derive's nightly feature.  I didn't
notice at the time because Mockall _also_ has a nightly feature, and so
does the only crate of mine that uses Mockall.

Fix the hygiene errors, and rename mockall_derive's feature to
"nightly_derive", which will help to catch similar errors in the future.
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

1 participant