We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fabc26f commit abc8eb7Copy full SHA for abc8eb7
clippy_lints/src/exhaustive_items.rs
@@ -78,7 +78,10 @@ impl LateLintPass<'_> for ExhaustiveItems {
78
if !attrs.iter().any(|a| a.has_name(sym::non_exhaustive));
79
then {
80
let (lint, msg) = if let ItemKind::Struct(ref v, ..) = item.kind {
81
- if v.fields().iter().any(|f| !f.vis.node.is_pub()) {
+ if v.fields().iter().any(|f| {
82
+ let def_id = cx.tcx.hir().local_def_id(f.hir_id);
83
+ !cx.tcx.visibility(def_id).is_public()
84
+ }) {
85
// skip structs with private fields
86
return;
87
}
0 commit comments