Skip to content

dead_code doesn't recognize use as an enum discriminant value #10993

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

Closed
sfackler opened this issue Dec 16, 2013 · 2 comments
Closed

dead_code doesn't recognize use as an enum discriminant value #10993

sfackler opened this issue Dec 16, 2013 · 2 comments

Comments

@sfackler
Copy link
Member

This program

static FOO: uint = 10;
pub enum Thing {
    Foo = FOO
}

throws a dead_code warning, but shouldn't:

test.rs:1:0: 1:22 warning: code is never used: `FOO`, #[warn(dead_code)] on by default
test.rs:1 static FOO: uint = 10;
          ^~~~~~~~~~~~~~~~~~~~~~
@alexcrichton
Copy link
Member

cc @ktt3ja

bors added a commit that referenced this issue Dec 16, 2013
Types used inside live struct or enum are now marked live.

Fix #10956 and #10993.
@alexcrichton
Copy link
Member

Thanks @ktt3ja!

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
Don't lint [`iter_nth_zero`] in `next`

Closes rust-lang#9820
This also *slightlyy* modifies the output of `iter_nth`, as I noticed the types' names weren't in backticks

changelog: [`iter_nth_zero`]: No longer lints in implementations of `Iterator::next`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants