Perform unused assignment and unused variables lints on MIR.#101500
Perform unused assignment and unused variables lints on MIR.#101500cjgillot wants to merge 3 commits intorust-lang:masterfrom
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras |
|
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
82c11f4 to
897b0db
Compare
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
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 was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
8844e49 to
521f4e2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
☔ The latest upstream changes (presumably #108944) made this pull request unmergeable. Please resolve the merge conflicts. |
|
The Miri subtree was changed cc @rust-lang/miri |
There was a problem hiding this comment.
Yes. Added it to the description.
There was a problem hiding this comment.
Actually, it doesn't need to be. I'll remove that commit in a few.
|
☔ The latest upstream changes (presumably #109303) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #109092) made this pull request unmergeable. Please resolve the merge conflicts. |
20ad900 to
8322e70
Compare
|
☔ The latest upstream changes (presumably #96840) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #106934) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Some changes might have occurred in exhaustiveness checking cc @Nadrieril |
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #113646) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@cjgillot any updates on this |
This comment was marked as outdated.
This comment was marked as outdated.
|
oh nvm this was blocked |
|
Some changes occurred in match lowering cc @Nadrieril |
| /// Is this the leftmost occurrence of the binding, i.e., is `var` the | ||
| /// `HirId` of this pattern? | ||
| is_primary: bool, | ||
| is_shorthand: bool, |
There was a problem hiding this comment.
Could you document what "shorthand" means?
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
☔ The latest upstream changes (presumably #123569) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Closing this as it's been blocked on another pr for a long time and that pr is in draft state and hasn't moved and this one has bitrotted. |
Based on #101399Based on #102256Blocked on #108993
Rough attempt to #51003.
This is my first stab at using the dataflow framework, so please be gentle 😄
In order to keep the same level of diagnostics, I had to instrument MIR a little more:
let _ =syntax. This changes the behaviour oflet _ = <access to unsafe field>currently type-checks #54003, I don't know if it's still desirable.VarBindingFormthe list of introducer places and whether this was a shorthand pattern.I am not very proud of the handling of self-assignments. The proposed scheme is in two parts: first detect probable self-assignments, by pattern matching on MIR, and second treat them specially during dataflow analysis. I welcome ideas.
I did not attempt to rewrite the dead-code lint, as #100288 does it.