diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-02-13 01:54:13 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-23 09:56:15 +0200 |
| commit | abc8eb71e6489b7677da54d082871ff498c6c91f (patch) | |
| tree | 55f024ba13cdc1d54a9c03b177486681d99ec625 | |
| parent | fabc26f7b7adabd153f3ee11f22c58ee247ab259 (diff) | |
| download | rust-abc8eb71e6489b7677da54d082871ff498c6c91f.tar.gz rust-abc8eb71e6489b7677da54d082871ff498c6c91f.zip | |
Drop vis in FieldDef.
| -rw-r--r-- | clippy_lints/src/exhaustive_items.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clippy_lints/src/exhaustive_items.rs b/clippy_lints/src/exhaustive_items.rs index b0f50b5c144..173d41b4b05 100644 --- a/clippy_lints/src/exhaustive_items.rs +++ b/clippy_lints/src/exhaustive_items.rs @@ -78,7 +78,10 @@ impl LateLintPass<'_> for ExhaustiveItems { if !attrs.iter().any(|a| a.has_name(sym::non_exhaustive)); then { 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 return; } |
