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 trips for publically exported struct variant fields #14837

Closed
sfackler opened this issue Jun 12, 2014 · 0 comments
Closed

Dead code lint trips for publically exported struct variant fields #14837

sfackler opened this issue Jun 12, 2014 · 0 comments
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@sfackler
Copy link
Member

This shouldn't trip the lint since the variant is visible outside the crate but it is:

#![feature(struct_variant)]
#![crate_type="lib"]

pub enum Foo {
    Bar {
        pub baz: int
    }
}
~ ❯ rustc test.rs
test.rs:6:13: 6:21 warning: code is never used: `baz`, #[warn(dead_code)] on by default
test.rs:6         pub baz: int
                      ^~~~~~~~
@sfackler sfackler changed the title Unused field lint trips for publically exported struct variant fields Dead code lint trips for publically exported struct variant fields Jun 12, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
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

Successfully merging a pull request may close this issue.

1 participant