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

Better StorageLive / StorageDead placement for constants. #44252

Closed
wants to merge 2 commits into from

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Sep 1, 2017

Fixes problems in miri (see rust-lang/miri#324 (comment)) caused by the new scope rules in #43932.
What I've tried to do here is always have a StorageLive but no StorageDead for 'static slots.
It might not work perfectly in all cases, but it should unblock miri.

r? @nikomatsakis cc @oli-obk

@nikomatsakis
Copy link
Contributor

r=me if we add some mir-opt tests -- but I think it'd be nicer to convert the queries to return a tuple, and get rid of this silent business. That seems awfully branch-heavy and error-prone to me. So if you wanted to do that, I'd be happier =)

@eddyb
Copy link
Member Author

eddyb commented Sep 1, 2017

@nikomatsakis It looks like I can't use mir-opt, as it looks for a subset, so the tests succeed even if I remove all the StorageDead from the expected MIR output - I only noticed this because EndRegion wasn't required and I thought this was special-cased for EndRegion.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 2, 2017

Side note: once I get miri into the test suite, we'll have tests for this.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

OMG this is so much better. I am disappointed about the tests though -- I think we have to fix that test harness, that "subset" property seems to bite everyone.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 2, 2017

📌 Commit 02ec0ae has been approved by nikomatsakis

@RalfJung
Copy link
Member

RalfJung commented Sep 2, 2017

I think we have to fix that test harness, that "subset" property seems to bite everyone.

Yes please :D

@bors
Copy link
Contributor

bors commented Sep 3, 2017

⌛ Testing commit 02ec0ae with merge 23ade23...

bors added a commit that referenced this pull request Sep 3, 2017
Better StorageLive / StorageDead placement for constants.

Fixes problems in miri (see rust-lang/miri#324 (comment)) caused by the new scope rules in #43932.
What I've tried to do here is always have a `StorageLive` but no `StorageDead` for `'static` slots.
It might not work perfectly in all cases, but it should unblock miri.

r? @nikomatsakis cc @oli-obk
@bors
Copy link
Contributor

bors commented Sep 3, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 23ade23 to master...

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.

5 participants