[compiler v2] enable warnings on unused private funcs, structs, and constants#18661
Draft
junxzm1990 wants to merge 4 commits intomainfrom
Draft
[compiler v2] enable warnings on unused private funcs, structs, and constants#18661junxzm1990 wants to merge 4 commits intomainfrom
junxzm1990 wants to merge 4 commits intomainfrom
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
515b56b to
6d71936
Compare
Add comprehensive unused entity detection for private functions, structs, and constants in Move compiler v2. This includes: - Optimize unused linter by tracking constant/struct usage during build instead of lazy computation - Add systematic type instantiation tracking to detect structs used as type parameters in all operations (vector<T>, helper<T>(), global storage) - Fix Lambda/Invoke handling to safely check module existence - Add extensive test coverage for various usage patterns Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
a8df025 to
75bcd31
Compare
…n 2.4 Struct visibility modifiers (public, package, friend) are only supported in language version 2.4+. Configure the unused entity detection tests to run with language version 2.4 and update baselines accordingly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…tion The is_target() check is redundant because the code is already inside an if caller_module.is_primary_target() block, and primary targets are always targets (is_primary_target implies is_target). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The warning flags use double-dash --W (long option), not single-dash -W. The reference to 'GCC style' was misleading since GCC uses -W but we use --W. Corrected documentation to consistently show --W<name> style with examples. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

Description
This PR
Warning Flag (
-W) PropagationFlow
Implementation
crates/aptos/src/common/types.rscrates/aptos/src/move_tool/mod.rsthird_party/move/tools/move-package/src/compilation/compiled_package.rsthird_party/move/move-compiler-v2/src/lib.rsthird_party/move/move-compiler-v2/src/env_pipeline/function_checker.rsCheck logic:
Backward Compatibility
warnings = vec--Wunusedor--Wallrequiredif options.warning_enabled("unused")Close #18652
How Has This Been Tested?
Type of Change
Which Components or Systems Does This Change Impact?