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

Add and use helper function for calling a machine function and passing it some arguments #1083

Merged
merged 2 commits into from
Nov 29, 2019

Conversation

RalfJung
Copy link
Member

No description provided.

let mir = this.load_mir(f.def, None)?;
this.push_stack_frame(
f,
DUMMY_SP, // There is no call site.
Copy link
Contributor

Choose a reason for hiding this comment

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

That's not true in general. You can take the current frame's current statement/terminator and get a span from that. If there are no frames, only then we definitely can't have a span because nothing calls the start function

Copy link
Member Author

Choose a reason for hiding this comment

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

As far as I can see, none of the code I am replacing did that correctly so far. They used DUMMY_SP or the span of the callee MIR, the latter being just blatantly wrong.

To avoid code duplication I'd prefer to add a Frame::current_source_info method on the rustc side and use that here. I'll add that to the rustc patch that I am working on anyway for #1070.

Would you prefer to block this PR on that? Either way is fine for me.

Copy link
Contributor

Choose a reason for hiding this comment

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

nah, this can totally happen later, you're right this is preexisting.

src/eval.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Nov 29, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Nov 29, 2019

📌 Commit e5a81c6 has been approved by oli-obk

@bors
Copy link
Contributor

bors commented Nov 29, 2019

⌛ Testing commit e5a81c6 with merge 59eee1a...

bors added a commit that referenced this pull request Nov 29, 2019
Add and use helper function for calling a machine function and passing it some arguments
@bors
Copy link
Contributor

bors commented Nov 29, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 59eee1a to master...

@bors bors merged commit e5a81c6 into rust-lang:master Nov 29, 2019
@RalfJung RalfJung deleted the fn-call-helper branch November 29, 2019 11:04
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