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

clean up trans_static_method_callee and friends #31072

Merged
merged 2 commits into from
Jan 22, 2016

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Jan 21, 2016

The old code was terribly ugly and was duplicated in several places.

r? @michaelwoerister

@arielb1 arielb1 force-pushed the method-callee-cleanup branch from 981afa7 to 29c296f Compare January 21, 2016 13:05
@michaelwoerister
Copy link
Member

I'll take a look at it ASAP.

let mthsubsts = tcx.mk_substs(mth.substs);
self.trans_fn_ref(bcx, ty, mthsubsts, mth.method.def_id)
let mth_substs = tcx.mk_substs(mth.substs);
self.trans_fn_ref(bcx, ty, mth_substs, mth.method.def_id)
Copy link
Member

Choose a reason for hiding this comment

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

Lovely!

@michaelwoerister
Copy link
Member

Very nice work! Much cleaner indeed.

Is there a specific reason you don't erase regions in some of the cases anymore? It probably doesn't matter most of the time, since the consumer of the Substs arguments will take care of erasing regions itself. A comment would be nice though.

r=me when you have taken care of that empty FIXME.

@arielb1
Copy link
Contributor Author

arielb1 commented Jan 21, 2016

fixed that

@arielb1
Copy link
Contributor Author

arielb1 commented Jan 21, 2016

We don't need to erase regions again because fulfill_obligation (in fact, infer::drain_fulfillment_cx) erases them for us.

@arielb1
Copy link
Contributor Author

arielb1 commented Jan 21, 2016

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Jan 21, 2016

📌 Commit 0a01d0b has been approved by michaelwoerister

@bors
Copy link
Contributor

bors commented Jan 22, 2016

⌛ Testing commit 0a01d0b with merge b4a2579...

bors added a commit that referenced this pull request Jan 22, 2016
The old code was terribly ugly and was duplicated in several places.

r? @michaelwoerister
@bors bors merged commit 0a01d0b into rust-lang:master Jan 22, 2016
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.

4 participants