Skip to content

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

Conversation

notriddle
Copy link
Contributor

Fixes #90285

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 15, 2022
@rust-highfive
Copy link
Contributor

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 15, 2022
ObligationCauseCode::FunctionCallObligation {
call_hir_id: expr.hir_id,
parent_code,
};
Copy link
Contributor

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.

Copy link
Contributor Author

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.

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 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.

Copy link
Contributor Author

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?

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 16, 2022
@JohnCSimon
Copy link
Member

@notriddle
Ping from triage: Can you please post the status of this PR? thanks.

@notriddle notriddle closed this Mar 20, 2022
@notriddle
Copy link
Contributor Author

It looks like it’s not happening. Which I guess is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add obligation cause code for function call trait bounds
5 participants