Skip to content

Fix unused_assignments false positive - #57302

Merged
bors merged 2 commits into
rust-lang:masterfrom
sinkuu:unused_assignments_fp
Jan 19, 2019
Merged

Fix unused_assignments false positive#57302
bors merged 2 commits into
rust-lang:masterfrom
sinkuu:unused_assignments_fp

Conversation

@sinkuu

@sinkuusinkuu commented Jan 3, 2019

Copy link
Copy Markdown
Contributor

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)

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

Copy link
Copy Markdown
Contributor

r? @estebank

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 3, 2019
@estebank

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Jan 18, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 069b0c4 has been approved by estebank

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 18, 2019
Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019
…ebank
Fix unused_assignments false positive
Fixesrust-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
@CentrilCentril mentioned this pull request Jan 18, 2019
bors added a commit that referenced this pull request Jan 18, 2019
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:masterJan 19, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sinkuu@rust-highfive@estebank@bors