Skip to content

delegation: emit error when there is an infer lifetime in user-specified args#156953

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
aerooneqq:delegation-emit-err-when-incorrect-gen-args
Jun 3, 2026
Merged

delegation: emit error when there is an infer lifetime in user-specified args#156953
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
aerooneqq:delegation-emit-err-when-incorrect-gen-args

Conversation

@aerooneqq
Copy link
Copy Markdown
Contributor

@aerooneqq aerooneqq commented May 26, 2026

This PR checks emit error if there as an infer lifetime anywhere in delegation's user-specified args. And delegation_user_specified_args is now query as we invoke it two times.

Fixes #156848. 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 May 26, 2026
@aerooneqq aerooneqq changed the title delegation: emit error when there is an error in lowered user-specified generic args delegation: emit error when there is an error in lowered user-specified generic args May 26, 2026
@petrochenkov petrochenkov added the F-fn_delegation `#![feature(fn_delegation)]` label May 26, 2026
Comment thread compiler/rustc_hir_analysis/src/delegation.rs Outdated
@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 May 26, 2026
@rust-bors

This comment has been minimized.

@aerooneqq aerooneqq force-pushed the delegation-emit-err-when-incorrect-gen-args branch from bcc26f4 to cb59243 Compare June 1, 2026 06:22
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 1, 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.

@rust-log-analyzer

This comment has been minimized.

@aerooneqq
Copy link
Copy Markdown
Contributor Author

Now the error is emitted from re_infer which should be better than before.
@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 Jun 1, 2026
@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_hir_analysis/src/collect.rs Outdated
Comment thread compiler/rustc_hir_analysis/src/errors.rs Outdated
Comment thread compiler/rustc_middle/src/queries.rs Outdated
Comment thread tests/ui/delegation/generics/unelided-lifetime-in-sig-ice-156848.rs
@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 Jun 2, 2026
@aerooneqq aerooneqq changed the title delegation: emit error when there is an error in lowered user-specified generic args delegation: emit error when there is an infer lifetime in user-specified args Jun 3, 2026
@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 Jun 3, 2026
@petrochenkov
Copy link
Copy Markdown
Contributor

r=me after squashing commits.
@rustbot author
@bors delegate+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 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.

View changes since this delegation.

@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 Jun 3, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 3, 2026

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

@aerooneqq aerooneqq force-pushed the delegation-emit-err-when-incorrect-gen-args branch from 02a4b16 to a10c598 Compare June 3, 2026 11:04
@aerooneqq
Copy link
Copy Markdown
Contributor Author

@bors r=petrochenkov

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

📌 Commit a10c598 has been approved by petrochenkov

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

@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 Jun 3, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 3, 2026
…-incorrect-gen-args, r=petrochenkov

delegation: emit error when there is an infer lifetime in user-specified args

This PR checks emit error if there as an infer lifetime anywhere in delegation's user-specified args. And `delegation_user_specified_args` is now query as we invoke it two times.

Fixes rust-lang#156848. Part of rust-lang#118212.
r? @petrochenkov
rust-bors Bot pushed a commit that referenced this pull request Jun 3, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #155763 (Promotes 5 Thumb-mode bare-metal Arm targets to Tier 2)
 - #156953 (delegation: emit error when there is an infer lifetime in user-specified args)
 - #157248 (delegation: move statements out of the first arg)
 - #157263 (rustc_codegen_ssa: Refactor `ArchiveEntry` to include entry kind)
 - #157311 (Use weak linkage for EII defaults)
 - #156089 (Fix unused_parens for pinned reference patterns)
 - #156928 (Remove -Zemscripten-wasm-eh)
 - #157236 (Reorganize `tests/ui/issues` [3/N])
 - #157287 (Const generics: remove AliasTerm::kind(), and small fixes)
 - #157294 (Split coroutine layout computation to its own file)
 - #157328 (windows: Elide division-by-zero checks in Instant::now())
 - #157331 (Rewrite target checking for `#[link]`)
 - #157336 (Enable `clippy::mem_replace_with_default`)
 - #157362 (Fix trivial wf module argument/doc comment name mismatches)
 - #157364 (Rewrite target checking of `rustc_dummy`)

Failed merges:

 - #157332 (Rewrite target checking for `#[sanitize]`)
@rust-bors rust-bors Bot merged commit 0cce238 into rust-lang:main Jun 3, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 3, 2026
rust-timer added a commit that referenced this pull request Jun 3, 2026
Rollup merge of #156953 - aerooneqq:delegation-emit-err-when-incorrect-gen-args, r=petrochenkov

delegation: emit error when there is an infer lifetime in user-specified args

This PR checks emit error if there as an infer lifetime anywhere in delegation's user-specified args. And `delegation_user_specified_args` is now query as we invoke it two times.

Fixes #156848. 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]: unelided lifetime in signature

4 participants