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

Represent function pointers in mir-constants as a Value instead of Item #40602

Merged
merged 2 commits into from
Mar 25, 2017

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Mar 17, 2017

r? @eddyb

Copy link
Member

@eddyb eddyb left a comment

Choose a reason for hiding this comment

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

LGTM except the hacks can be removed now!

// Shortcut for zero-sized types, including function item
// types, which would not work with MirConstContext.
// Shortcut for zero-sized types
// which would not work with MirConstContext.
Copy link
Member

Choose a reason for hiding this comment

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

I think this means it's a function-specific hack that can be removed.

@@ -927,8 +930,8 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
let ty = self.monomorphize(&constant.ty);
let result = match constant.literal.clone() {
mir::Literal::Item { def_id, substs } => {
// Shortcut for zero-sized types, including function item
// types, which would not work with MirConstContext.
// Shortcut for zero-sized types
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 17, 2017

Gotta run, so I can't test the changes locally. let's see what travis says.

@eddyb
Copy link
Member

eddyb commented Mar 17, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Mar 17, 2017

📌 Commit 187a922 has been approved by eddyb

arielb1 pushed a commit to arielb1/rust that referenced this pull request Mar 19, 2017
Represent function pointers in mir-constants as a Value instead of Item

r? @eddyb
@bors
Copy link
Contributor

bors commented Mar 20, 2017

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

@eddyb
Copy link
Member

eddyb commented Mar 21, 2017

You have a merge commit, please rebase properly.

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 21, 2017

since the MIR-shim changes I can't figure out how to make this work.

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 24, 2017

I applied the fixes as discussed in IRC. It works now.

@eddyb
Copy link
Member

eddyb commented Mar 24, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Mar 24, 2017

📌 Commit 9c91846 has been approved by eddyb

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 24, 2017
Represent function pointers in mir-constants as a Value instead of Item

r? @eddyb
bors added a commit that referenced this pull request Mar 24, 2017
Rollup of 8 pull requests

- Successful merges: #40567, #40602, #40636, #40739, #40756, #40790, #40794, #40803
- Failed merges:
@bors bors merged commit 9c91846 into rust-lang:master Mar 25, 2017
@oli-obk oli-obk deleted the fn_const branch June 15, 2020 15:25
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.

3 participants