Skip to content

feat: support inherent associated type paths#21758

Open
EienMiku wants to merge 2 commits intorust-lang:masterfrom
EienMiku:fix-inherent-associated-type-type-paths
Open

feat: support inherent associated type paths#21758
EienMiku wants to merge 2 commits intorust-lang:masterfrom
EienMiku:fix-inherent-associated-type-type-paths

Conversation

@EienMiku
Copy link

@EienMiku EienMiku commented Mar 5, 2026

Fixes #16240

Add path lowering support for inherent associated types (e.g. A::B where B is defined in an inherent impl, feature(inherent_associated_types)).
Also added a test inherent_associated_type_path in crates\hir-ty\src\tests\traits.rs.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 5, 2026
@EienMiku EienMiku force-pushed the fix-inherent-associated-type-type-paths branch 2 times, most recently from 6b29518 to 0bb621e Compare March 6, 2026 02:38
@rustbot

This comment has been minimized.

Add support for resolving paths for inherent associated types
@EienMiku EienMiku force-pushed the fix-inherent-associated-type-type-paths branch from 0bb621e to 88e5890 Compare March 6, 2026 03:49
@rustbot
Copy link
Collaborator

rustbot commented Mar 6, 2026

This PR was rebased onto a different master 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.

Extract the inherent impl type alias lookup into a shared
`find_inherent_assoc_type()` helper, wire it into IDE path
resolution
@EienMiku EienMiku force-pushed the fix-inherent-associated-type-type-paths branch from 88e5890 to f5214dc Compare March 6, 2026 04:08
@ChayimFriedman2
Copy link
Contributor

To be honest, I'm not keen of that. inherent_associated_types is an incomplete feature, it has an uncertain future, and we don't support it well in analysis either.

@rust-lang/rust-analyzer thoughts?

@ShoyuVanilla
Copy link
Member

It's on a t-types project goal draft and I guess most of the implementation has been done except trait object things(I'm poking into it but it has some irritating normalization issue), so I guess it worths implementing unless too complex, and this PR seems relatively simple.

But perhaps we should wait till much progress has been done on rustc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No autocompletion for inherent_associated_types nightly feature

4 participants