-
Notifications
You must be signed in to change notification settings - Fork 356
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
Conversation
…g it some arguments
let mir = this.load_mir(f.def, None)?; | ||
this.push_stack_frame( | ||
f, | ||
DUMMY_SP, // There is no call site. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@bors r+ |
📌 Commit e5a81c6 has been approved by |
Add and use helper function for calling a machine function and passing it some arguments
☀️ Test successful - checks-travis, status-appveyor |
No description provided.