-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Support recursive delegation #150024
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
base: main
Are you sure you want to change the base?
Support recursive delegation #150024
Conversation
| if visited.contains(&node_id) { | ||
| // We encountered a cycle in the resolution, or delegation callee refers to non-existent | ||
| // entity, in this case emit an error. | ||
| return Err(self.dcx().emit_err(UnresolvedDelegationCallee { span })); |
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.
The error wording here is particularly bad, it doesn't say anything about encountering a cycle, but says that there's a resolution error, which is not actually the case.
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.
Now we return UnresolvedDelegationCallee when there is only one visited node, which means that we failed to find the callee, in other cases we return CycleInDelegationSignatureResolution error, we may try to collect all spans of this cycle for better message, but I am not sure If we need it.
|
@rustbot ready |
This PR adds support for recursive delegations and is a part of the delegation feature #118212.
r? @petrochenkov