Eagerly resolve delegations in late resolution#157053
Open
oli-obk wants to merge 1 commit into
Open
Conversation
aerooneqq
reviewed
May 28, 2026
| // NodeId (either delegation.id or item_id in case of a trait impl) for signature resolution, | ||
| // for details see https://github.com/rust-lang/rust/issues/118212#issuecomment-2160686914 | ||
| pub resolution_node: ast::NodeId, | ||
| pub resolution_node: DefId, |
Contributor
There was a problem hiding this comment.
Nit: maybe resolution_id or res_def_id?
Contributor
There was a problem hiding this comment.
I'm still not sure what would be a good name for this.
Contributor
Author
There was a problem hiding this comment.
Can we just fully resolve in late resolution?
aerooneqq
reviewed
May 28, 2026
| self.r.tcx.dcx().span_delayed_bug( | ||
| delegation.path.span, | ||
| format!( | ||
| "LoweringContext: couldn't resolve node {:?} in delegation item", |
Contributor
There was a problem hiding this comment.
Suggested change
| "LoweringContext: couldn't resolve node {:?} in delegation item", | |
| "LateResolutionVisitor: couldn't resolve node {:?} in delegation item", |
| self.r.tcx.dcx().span_delayed_bug( | ||
| delegation.path.span, | ||
| format!( | ||
| "LoweringContext: couldn't resolve node {:?} in delegation item", |
Contributor
There was a problem hiding this comment.
Suggested change
| "LoweringContext: couldn't resolve node {:?} in delegation item", | |
| "LoweringContext: couldn't resolve node {resolution_node:?} in delegation item" |
| #[derive(Debug)] | ||
| pub struct DelegationInfo { | ||
| // NodeId (either delegation.id or item_id in case of a trait impl) for signature resolution, | ||
| // for details see https://github.com/rust-lang/rust/issues/118212#issuecomment-2160686914 |
Contributor
There was a problem hiding this comment.
This comment is still mostly relevant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is necessary for allowing the
partial_res_mapto be split by owners. The current logic followsNodeId->DefId->NodeIdmappings, but the resultingNodeIdis then not under the same owner, so we can't look it up in the current owner table. After this PR everything is just aDefId->DefIdmapping, which always works fine.cc @aerooneqq
r? @petrochenkov