Skip to content
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

Remove old util/liveness.rs module #71993

Merged
merged 2 commits into from
May 8, 2020

Conversation

ecstatic-morse
Copy link
Contributor

The liveness dataflow analysis now lives in the dataflow module, so this one is no longer necessary. I've copied the relevant bits of the module docs for util::liveness to MaybeLiveLocals. The example in the docs is now a mir-dataflow test:

fn foo() -> i32 {
let mut x: i32;
let mut p: *const i32;
x = 0;
// `x` is live here since it is used in the next statement...
unsafe { rustc_peek(x); }
p = &x;
// ... but not here, even while it can be accessed through `p`.
unsafe { rustc_peek(x); } //~ ERROR rustc_peek: bit not set
let tmp = unsafe { *p };
x = tmp + 1;
unsafe { rustc_peek(x); }
x
}

The borrow-checker used the same notion of "defs" and "uses", so I've moved it into a submodule. I would have moved it to util/def_use.rs, since it seems generally useful, but there's already a slightly different version of the same abstraction needed for copy propagation.

The liveness dataflow analysis now lives in
`librustc_mir/dataflow/impls/liveness.rs`. The borrow-checker has an
abstraction around of "defs" and "uses" that I've made module private. I
would have moved it to `util/def_use.rs`, but there's a slightly
different abstraction used for copy propagation with that name.
@rust-highfive
Copy link
Collaborator

r? @cramertj

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 7, 2020
@jonas-schievink
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 7, 2020

📌 Commit 046848e has been approved by jonas-schievink

@bors
Copy link
Contributor

bors commented May 7, 2020

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@bors bors 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 May 7, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 8, 2020
Rollup of 6 pull requests

Successful merges:

 - rust-lang#71989 (Use a single enum for the kind of a const context)
 - rust-lang#71993 (Remove old `util/liveness.rs` module)
 - rust-lang#71999 (Add myself to mailmap.)
 - rust-lang#72001 (Adjust cfg(version) to lang team decision)
 - rust-lang#72007 (Fix some tests failing in `--pass check` mode)
 - rust-lang#72008 (Add const-generics test)

Failed merges:

r? @ghost
@bors bors merged commit 681d747 into rust-lang:master May 8, 2020
@ecstatic-morse ecstatic-morse deleted the cleanup-old-liveness branch October 6, 2020 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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.

5 participants