Uh oh!
There was an error while loading. Please reload this page.
delegation: remove method call generation - #156541
Conversation
petrochenkov
commented
May 14, 2026
Is there specific motivation for this? I wouldn't expect this to work. I actually think we need to change the design to ignore the target expression entirely if there's no reuseTrait::{method, static_fn}{self.field}=> fnmethod(&self,a:A,b:B){self.field.method(a, b)// behavior, not exact desugaring}fnstatic_fn(a:A,b:B){Trait::static_fn(a, b)// no self, so the target expr is ignored} |
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
May 14, 2026
Or rather generate something like fnstatic_fn(a:A,b:B){
target_expr;// usually dead code and noopTrait::static_fn(a, b)// no self, so the target expr is ignored}to avoid issues like #154363 (comment). |
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.
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.
aerooneqq
commented
May 25, 2026
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
5734b0d to
0c5f5bdComparerustbot
commented
May 25, 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. |
petrochenkov
commented
May 25, 2026
Let's run benchmarks, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
delegation: remove method call generation
This comment has been minimized.
This comment has been minimized.
0c5f5bd to
40a7821Compareaerooneqq
commented
May 26, 2026
@rustbot ready |
petrochenkov
commented
May 26, 2026
@bors r+ |
This comment has been minimized.
This comment has been minimized.
…henkov delegation: remove method call generation This PR removes method call generation from delegations, now we always generate default call. Part of #118212. We reuse methods probing engine for finding needed adjustments, thus extending number of supported cases. In this PR adjustments are applied to trait methods (was supported before) ~and static functions (new feature)~. Free functions can be supported later. Finally this PR solves issues from parent generics propagation from #155906. r? @petrochenkov
💔 Test for 9db232a failed: CI. Failed job:
|
rust-log-analyzer
commented
May 26, 2026
A job failed! Check out the build log: (web)(plain enhanced)(plain) Click to see the possible cause of the failure (guessed by this bot) |
JonathanBrouwer
commented
May 26, 2026
@bors retry |
…l, r=petrochenkov delegation: remove method call generation This PR removes method call generation from delegations, now we always generate default call. Part of rust-lang#118212. We reuse methods probing engine for finding needed adjustments, thus extending number of supported cases. In this PR adjustments are applied to trait methods (was supported before) ~and static functions (new feature)~. Free functions can be supported later. Finally this PR solves issues from parent generics propagation from rust-lang#155906. r? @petrochenkov
…l, r=petrochenkov delegation: remove method call generation This PR removes method call generation from delegations, now we always generate default call. Part of rust-lang#118212. We reuse methods probing engine for finding needed adjustments, thus extending number of supported cases. In this PR adjustments are applied to trait methods (was supported before) ~and static functions (new feature)~. Free functions can be supported later. Finally this PR solves issues from parent generics propagation from rust-lang#155906. r? @petrochenkov
…uwer Rollup of 9 pull requests Successful merges: - #156959 (stdarch subtree update) - #156541 (delegation: remove method call generation) - #156161 (rustc_on_unimplemented: introduce format specifiers) - #156752 (fix E0371 description) - #156761 (tidy: remove duplicate entry and alphabetize OS constants list) - #156872 (Drop skip_move_check_fns query.) - #156899 (fix breakpoint callback registration in `lldb_batchmode`) - #156927 (Reorganize `tests/ui/issues` [1/N]) - #156947 (Update mdbook to 0.5.3)
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #156541 - aerooneqq:delegation-no-method-call, r=petrochenkov delegation: remove method call generation This PR removes method call generation from delegations, now we always generate default call. Part of #118212. We reuse methods probing engine for finding needed adjustments, thus extending number of supported cases. In this PR adjustments are applied to trait methods (was supported before) ~and static functions (new feature)~. Free functions can be supported later. Finally this PR solves issues from parent generics propagation from #155906. r? @petrochenkov
…uwer Rollup of 9 pull requests Successful merges: - rust-lang/rust#156959 (stdarch subtree update) - rust-lang/rust#156541 (delegation: remove method call generation) - rust-lang/rust#156161 (rustc_on_unimplemented: introduce format specifiers) - rust-lang/rust#156752 (fix E0371 description) - rust-lang/rust#156761 (tidy: remove duplicate entry and alphabetize OS constants list) - rust-lang/rust#156872 (Drop skip_move_check_fns query.) - rust-lang/rust#156899 (fix breakpoint callback registration in `lldb_batchmode`) - rust-lang/rust#156927 (Reorganize `tests/ui/issues` [1/N]) - rust-lang/rust#156947 (Update mdbook to 0.5.3)
…uwer Rollup of 9 pull requests Successful merges: - rust-lang/rust#156959 (stdarch subtree update) - rust-lang/rust#156541 (delegation: remove method call generation) - rust-lang/rust#156161 (rustc_on_unimplemented: introduce format specifiers) - rust-lang/rust#156752 (fix E0371 description) - rust-lang/rust#156761 (tidy: remove duplicate entry and alphabetize OS constants list) - rust-lang/rust#156872 (Drop skip_move_check_fns query.) - rust-lang/rust#156899 (fix breakpoint callback registration in `lldb_batchmode`) - rust-lang/rust#156927 (Reorganize `tests/ui/issues` [1/N]) - rust-lang/rust#156947 (Update mdbook to 0.5.3)
View all comments
This PR removes method call generation from delegations, now we always generate default call. Part of #118212.
We reuse methods probing engine for finding needed adjustments, thus extending number of supported cases. In this PR adjustments are applied to trait methods (was supported before)
and static functions (new feature). Free functions can be supported later.Finally this PR solves issues from parent generics propagation from #155906.
r? @petrochenkov