diff options
Diffstat (limited to 'gcc/rust/checks/lints/rust-lint-scan-deadcode.h')
-rw-r--r-- | gcc/rust/checks/lints/rust-lint-scan-deadcode.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/checks/lints/rust-lint-scan-deadcode.h b/gcc/rust/checks/lints/rust-lint-scan-deadcode.h index e6ef1392..0fc203b 100644 --- a/gcc/rust/checks/lints/rust-lint-scan-deadcode.h +++ b/gcc/rust/checks/lints/rust-lint-scan-deadcode.h @@ -93,7 +93,8 @@ public: { HirId field_hir_id = field.get_mappings ().get_hirid (); if (should_warn (field_hir_id) - && !field.get_visibility ().is_public ()) + && !field.get_visibility ().is_public () + && field.get_field_name ().as_string ().at (0) != '_') { rust_warning_at (field.get_locus (), 0, "field is never read: %qs", |