Skip to content

delegation: split resolution and lowering#157296

Open
aerooneqq wants to merge 10 commits into
rust-lang:mainfrom
aerooneqq:delegation-extract-resolve
Open

delegation: split resolution and lowering#157296
aerooneqq wants to merge 10 commits into
rust-lang:mainfrom
aerooneqq:delegation-extract-resolve

Conversation

@aerooneqq
Copy link
Copy Markdown
Contributor

@aerooneqq aerooneqq commented Jun 2, 2026

View all comments

This PR splits delegation's AST -> HIR lowering and its resolution. Now we resolve all delegations and then lower them. This should have benefits:

Part of #118212.
r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 2, 2026
@aerooneqq aerooneqq changed the title delegation: split delegation resolution and lowering delegation: split resolution and lowering Jun 2, 2026
@petrochenkov petrochenkov added the F-fn_delegation `#![feature(fn_delegation)]` label Jun 2, 2026
Comment thread compiler/rustc_ast/src/ast.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
Comment thread compiler/rustc_middle/src/hir/map.rs Outdated
@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 Jun 2, 2026
@aerooneqq
Copy link
Copy Markdown
Contributor Author

After changing Option<DefId> to Result<...> we started to emit UnresolvedDelegationCallee error during resolve, so new errors are added to tests, they were not added earlier as we had None in delegation_infos and old get_sig_id was not called at all.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 3, 2026
@rust-log-analyzer

This comment has been minimized.

@aerooneqq aerooneqq force-pushed the delegation-extract-resolve branch from a2ddcb3 to 4c2c364 Compare June 3, 2026 07:59
@aerooneqq
Copy link
Copy Markdown
Contributor Author

@rustbot author

@rustbot rustbot 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 Jun 3, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 3, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Comment thread compiler/rustc_middle/src/ty/mod.rs Outdated
Comment thread compiler/rustc_interface/src/passes.rs Outdated
Comment thread compiler/rustc_resolve/src/late.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/delegation.rs Outdated
@rust-bors

This comment has been minimized.

@aerooneqq aerooneqq force-pushed the delegation-extract-resolve branch from ba00c21 to 9259289 Compare June 4, 2026 06:07
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 4, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@aerooneqq aerooneqq force-pushed the delegation-extract-resolve branch from f4ee446 to 421e420 Compare June 4, 2026 06:14
@aerooneqq
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-fn_delegation `#![feature(fn_delegation)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

4 participants