Skip to content

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

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:delegation-generic-args-lowering-ice
Apr 10, 2026
Merged

delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition#155031
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
aerooneqq:delegation-generic-args-lowering-ice

Conversation

@aerooneqq
Copy link
Copy Markdown
Contributor

@aerooneqq aerooneqq commented Apr 9, 2026

View all comments

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

@aerooneqq aerooneqq force-pushed the delegation-generic-args-lowering-ice branch from 5a32e40 to 9e8069f Compare April 10, 2026 06:54
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 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.

@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 10, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors try jobs=x86_64-gnu-llvm-21-3

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 10, 2026
…e, r=<try>

delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition


try-job: x86_64-gnu-llvm-21-3
@petrochenkov
Copy link
Copy Markdown
Contributor

r=me after CI is green.

@petrochenkov
Copy link
Copy Markdown
Contributor

@rustbot author
@bors delegate+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

✌️ @aerooneqq, you can now approve this pull request!

If @petrochenkov told you to "r=me" after making some further change, then please make that change and post @bors 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. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 10, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

☀️ Try build successful (CI)
Build commit: 1e777aa (1e777aa357e03a51137afb68b540e903c1456c89, parent: 7659cec4ed1457bc0d1f636127e66e8fe5008928)

@aerooneqq
Copy link
Copy Markdown
Contributor Author

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

📌 Commit 9e8069f has been approved by aerooneqq

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 10, 2026
@fmease
Copy link
Copy Markdown
Member

fmease commented Apr 10, 2026

@bors r=petrochenkov

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

📌 Commit 9e8069f has been approved by petrochenkov

It is now in the queue for this repository.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 10, 2026
…lowering-ice, r=petrochenkov

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
rust-bors bot pushed a commit that referenced this pull request Apr 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #155047 (Always exhaustively match on typing mode)
 - #155080 (Simplify `try_load_from_disk_fn`.)
 - #152384 (Restrict EII declarations to functions at lowering time)
 - #153796 (Fix ICE when combining #[eii] with #[core::contracts::ensures])
 - #154369 (Fix `pattern_from_macro_note` for bit-or expr)
 - #155027 ( Rename some more of our internal `#[rustc_*]` TEST attributes)
 - #155031 (delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition)
 - #155040 (Fix code block whitespace handling in Markdown)
@rust-bors rust-bors bot merged commit 3b8c7ec into rust-lang:main Apr 10, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 10, 2026
rust-timer added a commit that referenced this pull request Apr 10, 2026
Rollup merge of #155031 - aerooneqq:delegation-generic-args-lowering-ice, r=petrochenkov

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

[ICE]: delegation: unelided lifetime in signature

6 participants