-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc_typeck: add obligation cause code for function call #94036
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
rustc_typeck: add obligation cause code for function call #94036
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
ObligationCauseCode::FunctionCallObligation { | ||
call_hir_id: expr.hir_id, | ||
parent_code, | ||
}; |
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.
I'm not sure what this PR really does.
Which obligation code was previously used for this case?
Can this new code make any observable changes in tests?
Also call_hir_id
is set here but never used.
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.
Which obligation code was previously used for this case?
That's the problem: almost any obligation code could have been previously used for this case. This code is used in any case where a function call introduces an obligation, but the obligation cannot be tracked down to a particular function parameter, so the function callee itself is used for the span.
Can this new code make any observable changes in tests?
It doesn't, no.
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 the problem: almost any obligation code could have been previously used for this case.
Why is that a problem though?
Why is it necessary to wrap the parent obligation into something instead of using it directly? Especially if it is not observable from the outside.
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.
I’m not sure.
@estebank what else did you want done here?
@notriddle |
It looks like it’s not happening. Which I guess is fine. |
Fixes #90285