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

Fix unused_assignments false positive #57302

Merged
merged 2 commits into from Jan 19, 2019

Conversation

Projects
None yet
4 participants
@sinkuu
Copy link
Contributor

sinkuu commented Jan 3, 2019

Fixes #22630.

In liveness analysis, make continue jump to the loop condition's LiveNode (cond as in comment) instead of the loop's one (expr).

We model control flow like this:
(cond) <--+
| |
v |
+-- (expr) |
| | |
| v |
| (body) ---+
|
|
v
(succ)

sinkuu added some commits Jan 3, 2019

Fix unused_assignments false positive
Make `continue` jump to the loop condition's `LiveNode` instead of one
of the loop body.
Cleanup
`for` loops are no longer closures.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 3, 2019

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Jan 18, 2019

@bors r+ rollup

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 18, 2019

📌 Commit 069b0c4 has been approved by estebank

Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019

Rollup merge of rust-lang#57302 - sinkuu:unused_assignments_fp, r=est…
…ebank

Fix unused_assignments false positive

Fixes rust-lang#22630.

In liveness analysis, make `continue` jump to the loop condition's `LiveNode` (`cond` as in comment) instead of the loop's one (`expr`).

https://github.com/rust-lang/rust/blob/069b0c410808c1d1d33b495e048b1186e9f8d57f/src/librustc/middle/liveness.rs#L1358-L1370

bors added a commit that referenced this pull request Jan 18, 2019

Auto merge of #57747 - Centril:rollup, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57132 (Document that `-C opt-level=0` implies `-C debug-assertions`.)
 - #57212 (docs(rustc): Link to the book's source in rustc)
 - #57302 (Fix unused_assignments false positive)
 - #57350 (Better error note on unimplemented Index trait for string)
 - #57635 (use structured macro and path resolve suggestions)
 - #57650 (librustc_metadata: Pass a default value when unwrapping a span)
 - #57657 (Add regression test to close #53787)
 - #57658 (Two HIR tweaks)
 - #57720 (Fix suggestions given mulitple bad lifetimes)
 - #57725 (Use structured suggestion to surround struct literal with parenthesis)

Failed merges:

r? @ghost

@bors bors merged commit 069b0c4 into rust-lang:master Jan 19, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment