Skip to content

Add static_assert attribute #6568

Closed
Closed
@emberian

Description

@emberian
 @graydon | if someone wants a cute task
 @graydon | I would be fond of an attribute called #[static_assert]
 @graydon | that, when applied to a static bool, halts compilation if the bool evaluates to false.
 @graydon | and is an error (or ignored) anywhere else
 @graydon | maybe optionally #[static_assert("why this is important")]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-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