Skip to content

MIR generation cleanup - #59560

Merged
bors merged 3 commits into
rust-lang:masterfrom
matthewjasper:mir-generation-cleanup
Apr 25, 2019
Merged

MIR generation cleanup#59560
bors merged 3 commits into
rust-lang:masterfrom
matthewjasper:mir-generation-cleanup

Conversation

@matthewjasper

Copy link
Copy Markdown
Contributor
  • Handle the case where the body of a constant is a subtype of the type of the constant (see mir_static_subtype.rs).
  • Move the evaluation of ExprKind::Use into into.rs, saving an unnecessary copy.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @varkor

(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 Mar 30, 2019
Comment threadsrc/test/run-pass/mir/mir_static_subtype.rs Outdated
@jonas-schievinkjonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 1, 2019
Comment threadsrc/librustc_mir/build/mod.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// type of it's body, which may be a subtype of this type. For
// type of its body, which may be a subtype of this type. For

@varkor

Copy link
Copy Markdown
Contributor

This looks reasonable to me, but I'm not so familiar with the MIR design choices, so it'd be good for someone to double-check. r? @oli-obk

@rust-highfiverust-highfive assigned oli-obk and unassigned varkorApr 2, 2019
@Dylan-DPC-zz

Copy link
Copy Markdown

ping from triage @oli-obk waiting for your review on this

@bors

bors commented Apr 20, 2019

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #59987) made this pull request unmergeable. Please resolve the merge conflicts.

@matthewjasper
matthewjasperforce-pushed the mir-generation-cleanup branch from 95b5423 to d3518a2CompareApril 22, 2019 15:41
@bors

bors commented Apr 24, 2019

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #60224) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk

Copy link
Copy Markdown
Contributor

lgtm. r=me after a rebase

sorry about taking so long

Cast type may be a subtype of the destination type. There is a later
assertion that they have the same layout.
Fixes an ICE for the following code:
fn foo(_ : &()) {}
static X: fn(&'static ()) = foo;
This avoids some unnecessary moves
@matthewjasper
matthewjasperforce-pushed the mir-generation-cleanup branch from d3518a2 to e9c687bCompareApril 24, 2019 19:28
@matthewjasper

Copy link
Copy Markdown
ContributorAuthor

@bors r=oli-obk

@bors

bors commented Apr 24, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit e9c687b has been approved by oli-obk

@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 Apr 24, 2019
Centril added a commit to Centril/rust that referenced this pull request Apr 25, 2019
…p, r=oli-obk
MIR generation cleanup
* Handle the case where the body of a constant is a subtype of the type of the constant (see `mir_static_subtype.rs`).
* Move the evaluation of `ExprKind::Use` into `into.rs`, saving an unnecessary copy.
@CentrilCentril mentioned this pull request Apr 25, 2019
bors added a commit that referenced this pull request Apr 25, 2019
Rollup of 6 pull requests
Successful merges:
- #59560 (MIR generation cleanup)
- #59697 (tweak unresolved label suggestion)
- #60038 (Add codegen test for PGO instrumentation.)
- #60160 (Fix#58270, fix off-by-one error in error diagnostics.)
- #60185 (Reexport IntErrorKind in std)
- #60243 (Add regression test for #53249.)
Failed merges:
r? @ghost
@bors

bors commented Apr 25, 2019

Copy link
Copy Markdown
Collaborator

⌛ Testing commit e9c687b with merge 9aea116...

@bors
bors merged commit e9c687b into rust-lang:masterApr 25, 2019
@matthewjasper
matthewjasper deleted the mir-generation-cleanup branch April 25, 2019 07:49
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.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@matthewjasper@rust-highfive@varkor@Dylan-DPC-zz@bors@oli-obk@jonas-schievink