-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustA-syntaxextArea: Syntax extensionsArea: Syntax extensionsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
A great C idiom is:
assert(condition && "Failure message");
In rust, I keep writing:
if !condition { fail "Failure message"; }
I'd be pretty happy with an #assert macro that took a condition and a failure message and generated appropriate code (easy), or perhaps changing the grammar of assert itself (less feasible).
Metadata
Metadata
Assignees
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustA-syntaxextArea: Syntax extensionsArea: Syntax extensionsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.