Uh oh!
There was an error while loading. Please reload this page.
delegation: support mapping of all arguments with Self type - #158690
Conversation
aerooneqq
commented
Jul 2, 2026
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
aa7bea6 to
5fdf384Compareaerooneqq
commented
Jul 6, 2026
@rustbot unblocked |
aerooneqq
commented
Jul 6, 2026
@rustbot ready |
d9515b1 to
541ec90CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
78e635d to
30fce5cCompare
This comment has been minimized.
This comment has been minimized.
aerooneqq
commented
Jul 7, 2026
@rustbot ready |
✌️ @aerooneqq, you can now approve this pull request! If @petrochenkov told you to " |
rustbot
commented
Jul 7, 2026
Reminder, once the PR becomes ready for a review, use |
aerooneqq
commented
Jul 7, 2026
Adjusted naming and message of an error too. |
aerooneqq
commented
Jul 7, 2026
@bors squash |
This comment has been minimized.
This comment has been minimized.
* Support mapping of all arguments with Self type * Address some review comments * Review: use #[cfg(debug_assertions)] on the whole module * Review: emit error when trying to map non-receiver argument when block contains definitions * Use `cfg_select` * Fix tidy * Unify mapping with `should_generate_block` * Better naming and message for error * loop -> `extend`
🔨 9 commits were squashed into 831a2e8. |
0398fb4 to
831a2e8Compareaerooneqq
commented
Jul 7, 2026
@bors r=petrochenkov |
…uments-wrapping, r=petrochenkov delegation: support mapping of all arguments with `Self` type 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 times 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 rust-lang#118212. r? @petrochenkov
Rollup of 8 pull requests Successful merges: - #156968 (diagnostics: suggest generic_const_args for const ops) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158905 (delegation: add constraints to new generic args)
…uments-wrapping, r=petrochenkov delegation: support mapping of all arguments with `Self` type 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 times 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 rust-lang#118212. r? @petrochenkov
…uments-wrapping, r=petrochenkov delegation: support mapping of all arguments with `Self` type 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 times 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 rust-lang#118212. r? @petrochenkov
…uwer Rollup of 11 pull requests Successful merges: - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args)
…uments-wrapping, r=petrochenkov delegation: support mapping of all arguments with `Self` type 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 times 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 rust-lang#118212. r? @petrochenkov
…uwer Rollup of 18 pull requests Successful merges: - #157385 (Enable Enzyme on x86_64-apple) - #157561 (rustdoc: do not include extra stuff in span) - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158697 (Fixes for QNX SDP 8) - #158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - #157801 (Rewrite safety requirements for `Allocator` impls) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158841 (Avoid final override ICE for RPITIT associated types) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args)
…uwer Rollup of 19 pull requests Successful merges: - #156016 (view-types: store view types in the AST) - #157385 (Enable Enzyme on x86_64-apple) - #158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - #158621 (disallow `extern "custom"` on wasm and spirv targets) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158697 (Fixes for QNX SDP 8) - #158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - #157801 (Rewrite safety requirements for `Allocator` impls) - #158085 (rustdoc: Fix sidebar heading order) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - #158791 (Avoid unused braces lint for macro generated arguments) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158841 (Avoid final override ICE for RPITIT associated types) - #158889 (tests: catch up with LLVM returning f128 on the stack) - #158905 (delegation: add constraints to new generic args) - #158922 (tests: clean up over-constraint on LLVM feature count) Failed merges: - #158617 (allow mGCA const arguments to fall back to anon consts)
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #158690 - aerooneqq:delegation-self-type-arguments-wrapping, r=petrochenkov delegation: support mapping of all arguments with `Self` type 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 times 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
…uwer Rollup of 19 pull requests Successful merges: - rust-lang/rust#156016 (view-types: store view types in the AST) - rust-lang/rust#157385 (Enable Enzyme on x86_64-apple) - rust-lang/rust#158179 (std: unconditionally use `preadv`/`pwritev` on AArch64 macOS) - rust-lang/rust#158621 (disallow `extern "custom"` on wasm and spirv targets) - rust-lang/rust#158690 (delegation: support mapping of all arguments with `Self` type) - rust-lang/rust#158696 (Rename some `body_id` to `body_def_id`) - rust-lang/rust#158697 (Fixes for QNX SDP 8) - rust-lang/rust#158760 (Clarify that `LocalKey::try_with` may return `AccessError`) - rust-lang/rust#157801 (Rewrite safety requirements for `Allocator` impls) - rust-lang/rust#158085 (rustdoc: Fix sidebar heading order) - rust-lang/rust#158333 (Fix typetree generation for differentiated functions) - rust-lang/rust#158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - rust-lang/rust#158701 ( diagnostics: suggest type annotation for closure params on HRTB FnOnce mismatch) - rust-lang/rust#158791 (Avoid unused braces lint for macro generated arguments) - rust-lang/rust#158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - rust-lang/rust#158841 (Avoid final override ICE for RPITIT associated types) - rust-lang/rust#158889 (tests: catch up with LLVM returning f128 on the stack) - rust-lang/rust#158905 (delegation: add constraints to new generic args) - rust-lang/rust#158922 (tests: clean up over-constraint on LLVM feature count) Failed merges: - rust-lang/rust#158617 (allow mGCA const arguments to fall back to anon consts)
View all comments
This PR supports applying target expression to arguments of
Selftype.That the first part of this feature which touches AST -> HIR lowering only and allows lowering of delegation's block several times 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