Skip to content

Allow custom messages on assert statements #5436

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

Merged
merged 1 commit into from
Mar 19, 2013

Conversation

alexcrichton
Copy link
Member

This would close #2761. I figured that if you're supplying your own custom message, you probably don't mind the stringification of the condition to not be in the message.

@bstrie
Copy link
Contributor

bstrie commented Mar 19, 2013

Would it be possible to redefine assert_eq! in terms of this now? Is assert_eq! still necessary in the face of this?

@alexcrichton
Copy link
Member Author

Looking at assert_eq!, it does have the nice ability of checking equality in both directions and also automatically generating a nicer message than the default with the actual values displayed.

It does look like it can be defined in terms of this, but I'd argue that it's not unnecessary to the point that it should be thrown out.

bors added a commit that referenced this pull request Mar 19, 2013
This would close #2761. I figured that if you're supplying your own custom message, you probably don't mind the stringification of the condition to not be in the message.
@bors bors closed this Mar 19, 2013
@bors bors merged commit 14df844 into rust-lang:incoming Mar 19, 2013
oli-obk pushed a commit to oli-obk/rust that referenced this pull request May 2, 2020
Earlier if arguments to method calls matched the above pattern they were
not reported. This patch ensures such arguments are checked as well.

Fixes rust-lang#5436
oli-obk pushed a commit to oli-obk/rust that referenced this pull request May 2, 2020
Check for clone-on-copy in argument positions

Earlier if arguments to method calls matched the above pattern they were
not reported. This patch ensures such arguments are checked as well.

Fixes rust-lang#5436

changelog: apply clone_on_copy lint to func args as well
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.

4 participants