Skip to content

delegation: support mapping of all arguments with Self type#158690

Draft
aerooneqq wants to merge 2 commits into
rust-lang:mainfrom
aerooneqq:delegation-self-type-arguments-wrapping
Draft

delegation: support mapping of all arguments with Self type#158690
aerooneqq wants to merge 2 commits into
rust-lang:mainfrom
aerooneqq:delegation-self-type-arguments-wrapping

Conversation

@aerooneqq

@aerooneqq aerooneqq commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR supports applying target expression to arguments of Self type.
That the first part of this feature which touches AST -> HIR lowering only and allows lowering of delegation's block several tumes when there are no definitions inside.
The second part will adjust typeck so we can apply adjustments to all mapped arguments as to the first argument of delegation. This should also eventually weak the condition of argument mapping allowing Box<Self>, Arc<Self>, etc.

Part of #118212.
r? @petrochenkov

@rustbot rustbot added 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. labels Jul 2, 2026
@aerooneqq

Copy link
Copy Markdown
Contributor Author

Blocked on #158434.
@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 2, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-gcc-core-tests failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   --> compiler/rustc_ast_lowering/src/lib.rs:112:9
    |
111 |     pub(crate) struct ReloweringChecker {
    |                       ----------------- fields in this struct
112 |         node_id_to_local_id: NodeMap<hir::ItemLocalId>,
    |         ^^^^^^^^^^^^^^^^^^^
113 |         relowering_permissions_count: usize,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `ReloweringChecker` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

warning: method `check` is never used
   --> compiler/rustc_ast_lowering/src/lib.rs:117:23
    |
116 |     impl ReloweringChecker {
    |     ---------------------- method in this implementation
117 |         pub(crate) fn check(&mut self, ast_node_id: NodeId, local_id: hir::ItemLocalId) {
    |                       ^^^^^

[RUSTC-TIMING] rustc_ast_lowering test:false 22.088
error: `rustc_ast_lowering` (lib) generated 2 warnings
error: warnings are denied by `build.warnings` configuration

Important

For more information how to resolve CI failures of this job, visit this link.

@petrochenkov petrochenkov added the F-fn_delegation `#![feature(fn_delegation)]` label Jul 2, 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-blocked Status: Blocked on something else such as an RFC or other implementation work. 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