Skip to content

delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition#155031

Open
aerooneqq wants to merge 1 commit intorust-lang:mainfrom
aerooneqq:delegation-generic-args-lowering-ice
Open

delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition#155031
aerooneqq wants to merge 1 commit intorust-lang:mainfrom
aerooneqq:delegation-generic-args-lowering-ice

Conversation

@aerooneqq
Copy link
Copy Markdown
Contributor

@aerooneqq aerooneqq commented Apr 9, 2026

This PR does two things:

  • First it restores lower_generic_args_of_path as it was before Implement AST -> HIR generics propagation in delegation #151864, as it turns out we should use GenericArgPosition::Type for generic args lowering for signature inheritance, as it will not cause lifetime inference and then ICEs during child args lowering,
  • Next it refactors GenericArgPosition enum replacing Value and MethodCall with Call(IsMethodCall), as the only place where we created Value or MethodCall variants was in check_generic_arg_count_for_call, where it was a match over is_method_call. Not sure it is needed, but seems cleaner to me.

Fixes #154178, part of #118212.

r? @petrochenkov

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

HIR ty lowering was modified

cc @fmease

@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 Apr 9, 2026
@rust-log-analyzer

This comment has been minimized.

@aerooneqq aerooneqq force-pushed the delegation-generic-args-lowering-ice branch from 1d62869 to 5eea9f8 Compare April 9, 2026 10:07
@petrochenkov petrochenkov added the F-fn_delegation `#![feature(fn_delegation)]` label Apr 9, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

📌 Commit 5eea9f8 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 Apr 9, 2026
Copy link
Copy Markdown
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, one minor nit. @bors r-

View changes since this review

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

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

@rust-bors rust-bors bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 9, 2026
@aerooneqq aerooneqq force-pushed the delegation-generic-args-lowering-ice branch from 5eea9f8 to 5a32e40 Compare April 9, 2026 12:47
@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 Apr 9, 2026
@aerooneqq aerooneqq changed the title delegation: fix unelided lifetime ICE, small refactoring of GenericArgPosition delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition Apr 9, 2026
@fmease
Copy link
Copy Markdown
Member

fmease commented Apr 9, 2026

Thanks!

@bors r=petrochenkov,fmease rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

📌 Commit 5a32e40 has been approved by petrochenkov,fmease

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 Apr 9, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 9, 2026
…lowering-ice, r=petrochenkov,fmease

delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition

This PR does two things:
- First it restores `lower_generic_args_of_path` as it was before rust-lang#151864, as it turns out we should use `GenericArgPosition::Type` for generic args lowering for signature inheritance, as it will not cause lifetime inference and then ICEs during child args lowering,
- Next it refactors `GenericArgPosition` enum replacing `Value` and `MethodCall` with `Call(IsMethodCall)`, as the only place where we created `Value` or `MethodCall` variants was in `check_generic_arg_count_for_call`, where it was a match over `is_method_call`. Not sure it is needed, but seems cleaner to me.

Fixes rust-lang#154178, part of rust-lang#118212.

r? @petrochenkov
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r-
#155061 (comment)

@rust-bors rust-bors bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 9, 2026
@rust-bors rust-bors bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 9, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

This pull request was unapproved.

This PR was contained in a rollup (#155061), which was unapproved.

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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: delegation: unelided lifetime in signature

6 participants