Drop vis in FieldDef.
This commit is contained in:
parent
fabc26f7b7
commit
abc8eb71e6
@ -78,7 +78,10 @@ impl LateLintPass<'_> for ExhaustiveItems {
|
|||||||
if !attrs.iter().any(|a| a.has_name(sym::non_exhaustive));
|
if !attrs.iter().any(|a| a.has_name(sym::non_exhaustive));
|
||||||
then {
|
then {
|
||||||
let (lint, msg) = if let ItemKind::Struct(ref v, ..) = item.kind {
|
let (lint, msg) = if let ItemKind::Struct(ref v, ..) = item.kind {
|
||||||
if v.fields().iter().any(|f| !f.vis.node.is_pub()) {
|
if v.fields().iter().any(|f| {
|
||||||
|
let def_id = cx.tcx.hir().local_def_id(f.hir_id);
|
||||||
|
!cx.tcx.visibility(def_id).is_public()
|
||||||
|
}) {
|
||||||
// skip structs with private fields
|
// skip structs with private fields
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user