Skip to content

Always generate generics in delegation that match trait in trait impl scenario#153705

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:delegation-impl-trait-generics
Mar 12, 2026
Merged

Always generate generics in delegation that match trait in trait impl scenario#153705
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:delegation-impl-trait-generics

Conversation

@aerooneqq
Copy link
Contributor

@aerooneqq aerooneqq commented Mar 11, 2026

After #151864 there is a change in delegation code generation in trait impl cases: after #151864 we started to look at user-specified args and generate functions, whose generics may not match the signature of the function that is defined in trait. Such handling of delegation from trait impl is not correct, as the generated function should always have the same generics as its signature function in trait.

This addresses the "Fix generic params generation in trait impl case" future work from #151864. 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 Mar 11, 2026
@rust-log-analyzer

This comment has been minimized.

@aerooneqq aerooneqq force-pushed the delegation-impl-trait-generics branch from f413a06 to 23a51f5 Compare March 11, 2026 10:33
@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 Mar 11, 2026
@aerooneqq aerooneqq changed the title Always generate generics in delegation that match trait in impl trait scenario Always generate generics in delegation that match trait in trait impl scenario Mar 11, 2026
@aerooneqq
Copy link
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 Mar 12, 2026
@petrochenkov
Copy link
Contributor

r=me after addressing #153705 (comment) and squashing commits.
@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 Mar 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2026

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

@aerooneqq aerooneqq force-pushed the delegation-impl-trait-generics branch from fee1ded to d87d7b9 Compare March 12, 2026 14:25
@aerooneqq
Copy link
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 Mar 12, 2026
@petrochenkov
Copy link
Contributor

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

📌 Commit d87d7b9 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 12, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

⌛ Testing commit d87d7b9 with merge 353e13e...

Workflow: https://github.com/rust-lang/rust/actions/runs/23008037396

rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
…etrochenkov

Always generate generics in delegation that match trait in trait impl scenario

After #151864 there is a change in delegation code generation in `trait impl` cases: after #151864 we started to look at user-specified args and generate functions, whose generics may not match the signature of the function that is defined in trait. Such handling of delegation from trait impl is not correct, as the generated function should always have the same generics as its signature function in trait.

This addresses the "Fix generic params generation in trait impl case" future work from #151864

r? @petrochenkov
@JonathanBrouwer
Copy link
Contributor

@bors yield
Yielding to enclosing rollup

@JonathanBrouwer
Copy link
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #153783.

rust-bors bot pushed a commit that referenced this pull request Mar 12, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #153705 (Always generate generics in delegation that match trait in trait impl scenario)
 - #153751 (Detect existing turbofish on method calls to suppress useless suggestion)
 - #153780 (Remove `MTLock`)
 - #151572 (Fix Hexagon ABI calling convention for small aggregates)
 - #153725 (Fix that `./x test --no-doc` actually keeps the same behaviour for backwards compatability)
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 12, 2026

❗ There is currently no auto build in progress on this PR.

@rust-bors rust-bors bot merged commit 3d486d2 into rust-lang:main Mar 12, 2026
11 of 12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 12, 2026
@aerooneqq aerooneqq deleted the delegation-impl-trait-generics branch March 13, 2026 12:43
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Mar 16, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#153705 (Always generate generics in delegation that match trait in trait impl scenario)
 - rust-lang/rust#153751 (Detect existing turbofish on method calls to suppress useless suggestion)
 - rust-lang/rust#153780 (Remove `MTLock`)
 - rust-lang/rust#151572 (Fix Hexagon ABI calling convention for small aggregates)
 - rust-lang/rust#153725 (Fix that `./x test --no-doc` actually keeps the same behaviour for backwards compatability)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants