Skip to content

rustc_mir: promote references of statics from other statics.#46524

Merged
bors merged 1 commit into
rust-lang:masterfrom
eddyb:static-static
Dec 7, 2017
Merged

rustc_mir: promote references of statics from other statics.#46524
bors merged 1 commit into
rust-lang:masterfrom
eddyb:static-static

Conversation

@eddyb

@eddyb eddyb commented Dec 5, 2017

Copy link
Copy Markdown
Contributor

Fixes #46522 by also allowing STATIC_REF in MIR const-qualification, not just AST rvalue promotion.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

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

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.

nit: I would prefer that this codepath be shared with the shuffle index code into a fn can_promote

@arielb1

arielb1 commented Dec 5, 2017

Copy link
Copy Markdown
Contributor

r=me with nit fixed

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.

Why only in other statics? Couldn't references to statics always be promoted

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's just what we already allow. Must avoid letting in more until miri is in use.

@eddyb

eddyb commented Dec 6, 2017

Copy link
Copy Markdown
Contributor Author

@arielb1 The Travis failure suggests MIR borrowck doesn't handle this yet. Does it need your PR?

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 6, 2017
@arielb1

arielb1 commented Dec 6, 2017

Copy link
Copy Markdown
Contributor

@eddyb

Maybe. I don't remember the state of MIR borrowck before this PR. I suppose we can wait - this doesn't block me.

@kennytm kennytm added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 6, 2017
@kennytm

kennytm commented Dec 6, 2017

Copy link
Copy Markdown
Member

Marking as blocked by #46268.

@eddyb eddyb removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Dec 6, 2017
@eddyb

eddyb commented Dec 6, 2017

Copy link
Copy Markdown
Contributor Author

@bors r=arielb1

@bors

bors commented Dec 6, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 292c6ac has been approved by arielb1

@bors

bors commented Dec 6, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 292c6ac with merge 061bdb5...

bors added a commit that referenced this pull request Dec 6, 2017
rustc_mir: promote references of statics from other statics.

Fixes #46522 by also allowing `STATIC_REF` in MIR const-qualification, not just AST rvalue promotion.
@bors

bors commented Dec 7, 2017

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: arielb1
Pushing 061bdb5 to master...

@bors bors merged commit 292c6ac into rust-lang:master Dec 7, 2017
@eddyb eddyb deleted the static-static branch December 7, 2017 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants