-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Clarify use of assert!
and debug_assert!
in the documentation
#34455
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
Comments
I would be happy to work with anyone who wants to tackle this issue |
I don't know how easy this is. At the same time, both Finally, From other programming languages that I know, these second use-case is what I typically relate with assertions. Those programming languages, however, don't have the safe/unsafe code distinction. I guess I would write something like:
|
I guess my thinking is that this is technically easy: you just have to know where to add the text. Part of what I imagine working with someone on here is exactly how it's presented. On Jun 27, 2016, 19:40 -0400, gnzlbgnotifications@github.com, wrote:
|
@steveklabnik I'd like to work on this with you. Where should one begin? |
@munyari great! So, https://github.com/rust-lang/rust/blob/master/src/libcore/macros.rs#L33-L60 and https://github.com/rust-lang/rust/blob/master/src/libcore/macros.rs#L111-L145 are where the text goes. What do you think about @gnzlbg 's draft of the comments? Feel free to open a PR (I can help walk you through that too if you need) with it, or some variant of it, in your own words, and we can go from there 😄 |
Just opened a PR @steveklabnik 😄 |
Update docs for assert! and debug_assert! Refer to rust-lang#34455
Thanks @munyari ! |
A discussion with @gnzlbg lead us to determine that the proper way to use
assert!
anddebug_assert!
is confusing. It could be clarified in the documentation as to how they should be used, e.g. proper use in production, proper use for debugging.The text was updated successfully, but these errors were encountered: