Skip to content

Static assertions are marked as dead code #13951

Description

@jdm
#[static_assert]
static a: bool = 1 == 1;

fn main() {
}
/tmp/sa.rs:2:1: 2:25 warning: code is never used: `a`, #[warn(dead_code)] on by default
/tmp/sa.rs:2 static a: bool = 1 == 1;
             ^~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions