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

Don't track local_needs_drop separately in qualify_consts. #47306

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

alexreg
Copy link
Contributor

@alexreg alexreg commented Jan 10, 2018

No description provided.

@@ -538,7 +538,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {

// Mark the consumed locals to indicate later drops are noops.
if let Place::Local(local) = *place {
self.local_needs_drop[local] = None;
self.local_needs_drop.remove(local.index());
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I feel like this shouldn't happen unless we have a Move. Also, we can probably "just" remove NEEDS_DROP here from self.temp_qualif[local], and check that later, instead of having a separate bitvec.

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 10, 2018
@alexreg alexreg force-pushed the dataflow-analysis branch 4 times, most recently from 0ac224b to 7f866a2 Compare January 11, 2018 17:24
@alexreg alexreg changed the title Preparation for dataflow analysis in MIRI const evaluation Don't track local_needs_drop separately in qualify_consts. Jan 11, 2018
@@ -844,12 +845,14 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {

// Deny *any* live drops anywhere other than functions.
if self.mode != Mode::Fn {
// HACK(eddyb) Emulate a bit of dataflow analysis,
// conservatively, that drop elaboration will do.
Copy link
Member

Choose a reason for hiding this comment

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

Need to keep this comment around because this is still emulated until we use something more like what drop elaboration does.

pub const fn drop<T>(_: T) {}

pub const fn drop2<T>(x: T) {
(x, ()).1
Copy link
Member

Choose a reason for hiding this comment

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

You need to add //~^ ERROR comments (assuming they get caught now).

@alexreg alexreg force-pushed the dataflow-analysis branch 2 times, most recently from dab557d to 5038760 Compare January 11, 2018 19:54
@alexreg
Copy link
Contributor Author

alexreg commented Jan 11, 2018

Tests passing. LGTM, @eddyb!

@eddyb
Copy link
Member

eddyb commented Jan 11, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Jan 11, 2018

📌 Commit e2c1a93 has been approved by eddyb

@kennytm kennytm 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 11, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jan 12, 2018
Don't track local_needs_drop separately in qualify_consts.

None
bors added a commit that referenced this pull request Jan 12, 2018
@bors bors merged commit e2c1a93 into rust-lang:master Jan 12, 2018
@alexreg alexreg deleted the dataflow-analysis branch January 13, 2018 00:04
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.

4 participants