-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[compiler-v2][lint] Needless mutable reference checker #14651
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14651 +/- ##
========================================
Coverage 59.7% 59.8%
========================================
Files 850 851 +1
Lines 207109 207246 +137
========================================
+ Hits 123845 123982 +137
Misses 83264 83264 ☔ View full report in Codecov by Sentry. |
902ccc8
to
33fb140
Compare
third_party/move/move-compiler-v2/src/pipeline/lint_processor/needless_mutable_reference.rs
Outdated
Show resolved
Hide resolved
third_party/move/move-compiler-v2/src/pipeline/lint_processor/needless_mutable_reference.rs
Show resolved
Hide resolved
33fb140
to
9426207
Compare
...e/move-compiler-v2/tests/lints/stackless_bytecode_lints/needless_mutable_reference_warn.move
Show resolved
Hide resolved
9426207
to
981068f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good, but could use a few more tests of other data types than u64.
third_party/move/move-compiler-v2/src/pipeline/lint_processor/needless_mutable_reference.rs
Outdated
Show resolved
Hide resolved
...e/move-compiler-v2/tests/lints/stackless_bytecode_lints/needless_mutable_reference_warn.move
Show resolved
Hide resolved
third_party/move/move-compiler-v2/src/pipeline/lint_processor/needless_mutable_reference.rs
Show resolved
Hide resolved
981068f
to
f778db8
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1 similar comment
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, except that lint warnings should be sorted so that they match line order. That may be just in the test framework, but for real use cases you need to fix it.
268d3c6
to
dfcb0d9
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9ed494c
to
e39b231
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
This PR implements a new lint checker (at the stackless bytecode level) that looks for
&mut
andborrow_global_mut
that are needless, and suggests to instead use&
andborrow_global
instead.This lint finds several violations on the aptos framework, and I have verified them to be true positives.
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
Key Areas to Review