Skip to content

allow attaching strings to assert messages #2761

Closed
@bblum

Description

@bblum

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

No one assigned

    Labels

    A-grammarArea: The grammar of RustA-syntaxextArea: Syntax extensionsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions