Add checks for enums in scan-deadcode#4392
Open
Villosse wants to merge 4 commits into
Open
Conversation
Contributor
Author
|
I still need to fix tests that does not pass testsuite (with new warning, it seems logic) |
Member
|
Hello, |
Adds missing warnings for Enums. Fixes: Rust-GCC#4367 gcc/rust/ChangeLog: * checks/lints/rust-lint-scan-deadcode.h: Add warnings for Enums. Signed-off-by: lenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr>
Adds simple test with unused Enum. Addresses Rust-GCC#4367 gcc/testsuite/ChangeLog: * rust/compile/issue-4367.rs: New test. Signed-off-by: lenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr>
CohenArthur
marked this pull request as ready for review
June 11, 2026 14:40
CohenArthur
enabled auto-merge
June 11, 2026 15:48
gcc/rust/ChangeLog: * checks/lints/rust-lint-scan-deadcode.h: Add more functions that are reused throught the visitor and make `should_warn` perform all checks.
Since we now check for unused enums, we have to tweak the testuite to reflect that. gcc/testsuite/ChangeLog: * rust/compile/derive-debug1.rs: Add missing `pub` qualifier. * rust/compile/derive-hash1.rs: Likewise. * rust/compile/derive_clone_enum1.rs: Likewise. * rust/compile/derive_clone_enum2.rs: Likewise. * rust/compile/derive_clone_enum3.rs: Likewise. * rust/compile/enum_discriminant1.rs: Likewise. * rust/compile/for-loop1.rs: Likewise. * rust/compile/for-loop2.rs: Likewise. * rust/compile/glob_import_enum.rs: Likewise. * rust/compile/if_let_expr_simple.rs: Likewise. * rust/compile/issue-3382.rs: Likewise. * rust/compile/issue-3550.rs: Likewise. * rust/compile/issue-3597.rs: Likewise. * rust/compile/issue-3605.rs: Likewise. * rust/compile/issue-3651.rs: Likewise. * rust/compile/issue-3670.rs: Likewise. * rust/compile/issue-4367.rs: Likewise. * rust/compile/issue-850.rs: Likewise. * rust/compile/iterators1.rs: Likewise. * rust/compile/parse_associated_type_as_generic_arg.rs: Likewise. * rust/compile/parse_associated_type_as_generic_arg2.rs: Likewise. * rust/compile/parse_associated_type_as_generic_arg3.rs: Likewise. * rust/compile/torture/tuple_enum_variants.rs: Likewise. * rust/compile/torture/utf8_identifiers.rs: Likewise. * rust/compile/try-trait.rs: Likewise. * rust/compile/try_block1.rs: Likewise. * rust/compile/while_let1.rs: Likewise. * rust/execute/torture/enum_intrinsics2.rs: Likewise. * rust/execute/torture/for-loop1.rs: Likewise. * rust/execute/torture/for-loop2.rs: Likewise. * rust/execute/torture/iter1.rs: Likewise.
CohenArthur
disabled auto-merge
June 11, 2026 16:36
CohenArthur
enabled auto-merge
June 11, 2026 16:36
philberty
disabled auto-merge
June 29, 2026 17:15
Member
|
looks like its got 1 failing test a rebase and slight update should get this merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4367