Skip to content

Add static_assert attribute #6568

Closed
Closed
@emberian

Description

@emberian
Member
 @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")]

Activity

emberian

emberian commented on May 19, 2013

@emberian
MemberAuthor

@graydon could you provide some examples so I can test what I have so far?

emberian

emberian commented on May 22, 2013

@emberian
MemberAuthor

Fixed by #6670

added a commit that references this issue on Apr 22, 2021

Auto merge of rust-lang#6568 - Jarcho:redundant_pattern_matching, r=f…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @emberian

        Issue actions

          Add static_assert attribute · Issue #6568 · rust-lang/rust