Skip to content

name elided lifetimes in use<...> suggestion when impl Trait params are present - #165194

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Albab-Hasan:name-anon-lifetimes-with-apit
Nov 7, 2026
Merged

rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Albab-Hasan:name-anon-lifetimes-with-apit

Conversation

@Albab-Hasan

Copy link
Copy Markdown
Contributor

follow up to #163684. when an APIT appeared alongside two or more elided lifetimes the suggestion kept '_ and applying it gave E0106 on top of E0700. the suggestion now names the lifetimes and the APIT together in one list.

gap: a lifetime inside an APIT bound as in impl Iterator<Item = &u8> still falls back to '_ because naming it would overlap the APIT rewrite and panic the emitter. that suggestion remains wrong and is only reachable under anonymous_lifetime_in_impl_trait.

r? oli-obk

@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 Oct 30, 2026

@oli-obk oli-obk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 81bbd86 has been approved by oli-obk

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 Nov 6, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 6, 2026
…th-apit, r=oli-obk

name elided lifetimes in `use<...>` suggestion when `impl Trait` params are present

follow up to rust-lang#163684. when an APIT appeared alongside two or more elided lifetimes the suggestion kept `'_` and applying it gave E0106 on top of E0700. the suggestion now names the lifetimes and the APIT together in one list.

gap: a lifetime inside an APIT bound as in `impl Iterator<Item = &u8>` still falls back to `'_` because naming it would overlap the APIT rewrite and panic the emitter. that suggestion remains wrong and is only reachable under `anonymous_lifetime_in_impl_trait`.

r? oli-obk
rust-bors Bot pushed a commit that referenced this pull request Nov 6, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #164784 (Introduce OptimizationObjective and fix the entry shim's size attributes)
 - #165037 (Drop array elements in order after a partial move)
 - #165078 (Use the `2.38` binutils version in CI)
 - #159374 (Lower #[no_mangle] to #[symbol_name]/#[link_name])
 - #163284 (feat(Reborrow): Allow multiple lifetimes)
 - #164775 (Tweak output on misused `const` parameter to provide more context and more accurate suggestion)
 - #165194 (name elided lifetimes in `use<...>` suggestion when `impl Trait` params are present)
 - #165222 (Anonymize inner binders when checking refining)
 - #165335 (Fallible type ops)
 - #165388 (Accept variadic SysV64, Win64, and Aapcs FnAbis in rustc_public)
 - #165448 (Update `Vec::retain_unstable` docs to say that this method is generally faster than `Vec::retain_mut`)
 - #165494 (fix Miri ICE on exit with () return type)
 - #165503 (update Enzyme submodule)
 - #165505 (DFV: Reject `#[non_exhaustive]` on enum variants with default field values)
 - #165512 (Fix warnings for the L4Re targets)
 - #165514 (Remove unused `WhereEqPredicate` and `ScopeId` types)
 - #165518 (style-guide: Remove ABI explicitness prescription for extern items)
 - #165519 (Update books)
 - #165534 (rename MIR_borrow_checking timing scope to less confusing name)
rust-bors Bot pushed a commit that referenced this pull request Nov 7, 2026
Rollup of 15 pull requests

Successful merges:

 - #165037 (Drop array elements in order after a partial move)
 - #165550 (Make `Literal::cstr_value` return a `CString`)
 - #159374 (Lower #[no_mangle] to #[symbol_name]/#[link_name])
 - #163284 (feat(Reborrow): Allow multiple lifetimes)
 - #164775 (Tweak output on misused `const` parameter to provide more context and more accurate suggestion)
 - #165194 (name elided lifetimes in `use<...>` suggestion when `impl Trait` params are present)
 - #165222 (Anonymize inner binders when checking refining)
 - #165335 (Fallible type ops)
 - #165388 (Accept variadic SysV64, Win64, and Aapcs FnAbis in rustc_public)
 - #165448 (Update `Vec::retain_unstable` docs to say that this method is generally faster than `Vec::retain_mut`)
 - #165494 (fix Miri ICE on exit with () return type)
 - #165505 (DFV: Reject `#[non_exhaustive]` on enum variants with default field values)
 - #165512 (Fix warnings for the L4Re targets)
 - #165514 (Remove unused `WhereEqPredicate` and `ScopeId` types)
 - #165518 (style-guide: Remove ABI explicitness prescription for extern items)
@rust-bors
rust-bors Bot merged commit 462ab40 into rust-lang:main Nov 7, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 7, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 7, 2026
Rollup merge of #165194 - Albab-Hasan:name-anon-lifetimes-with-apit, r=oli-obk

name elided lifetimes in `use<...>` suggestion when `impl Trait` params are present

follow up to #163684. when an APIT appeared alongside two or more elided lifetimes the suggestion kept `'_` and applying it gave E0106 on top of E0700. the suggestion now names the lifetimes and the APIT together in one list.

gap: a lifetime inside an APIT bound as in `impl Iterator<Item = &u8>` still falls back to `'_` because naming it would overlap the APIT rewrite and panic the emitter. that suggestion remains wrong and is only reachable under `anonymous_lifetime_in_impl_trait`.

r? oli-obk
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.

3 participants