Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead code lint shouldn't warn about #[static_assert] statics #14226

Closed
huonw opened this issue May 15, 2014 · 1 comment
Closed

Dead code lint shouldn't warn about #[static_assert] statics #14226

huonw opened this issue May 15, 2014 · 1 comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@huonw
Copy link
Member

huonw commented May 15, 2014

#[static_assert]
static X: bool = true;

fn main() {}
static-assert.rs:2:1: 2:23 warning: code is never used: `X`, #[warn(dead_code)] on by default
static-assert.rs:2 static X: bool = true;
                   ^~~~~~~~~~~~~~~~~~~~~~

These might not be used directly in the rest of the code, but they are still serving a concrete purpose, i.e. they are being semantically used.

@huonw huonw added the A-lint label May 15, 2014
@jdm
Copy link
Contributor

jdm commented May 15, 2014

Duplicate of #13951.

@jdm jdm closed this as completed May 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

2 participants