Skip to content

Conversation

@fmease
Copy link
Member

@fmease fmease commented Nov 9, 2025

Apparently, some people are already using IATs in their projects and get blocked by #142006 (comment) (cc dupes #143952 & #148535). Since the (temporary) fix is so trivial, let's just do it.

Addresses #142006 (comment).

cc @luissantosHCIT (#148535).

r? @BoxyUwU

@fmease fmease added F-inherent_associated_types `#![feature(inherent_associated_types)]` T-types Relevant to the types team, which will review and decide on the PR/issue. labels Nov 9, 2025
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2025

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

Some(InherentAssocCandidate { impl_, assoc_item: item.def_id, scope })
})
.collect();

Copy link
Member Author

@fmease fmease Nov 9, 2025

Choose a reason for hiding this comment

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

Obviously this is but a hotfix for a minute part of #142006. I was briefly toying with the idea of properly addressing #142006 now but for that I would need to rewrite type-relative path resolution in HIR ty lowering to properly assemble inherent & trait candidates (instead of eagerly trying to resolve them in sequence) but I realized I would only be stepping on your toes / doing throwaway work (#145825).

Copy link
Member Author

@fmease fmease Nov 9, 2025

Choose a reason for hiding this comment

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

I wrote this test and it's rooted in a deep misconception, namely that there can't ever be a case where we would pick a trait candidate over an inherent one. Back then I didn't know about #142006.

In essence, I don't like this test, hence its removal. Once we fix #142006, we'll have plenty of tests regarding "candidate preference/elimination".

@fmease fmease force-pushed the iat-reinstate-early-elim branch from 129c7f0 to a9fd741 Compare November 9, 2025 21:46
@fmease fmease force-pushed the iat-reinstate-early-elim branch from a9fd741 to 6ed469c Compare November 9, 2025 21:53
@fmease fmease changed the title Reinstate early IAT candidate elimination IAT: Reinstate early bailout Nov 9, 2025
@BoxyUwU
Copy link
Member

BoxyUwU commented Nov 10, 2025

@bors r+

lgtm. i thought i'd get around to fixing type relative path lowering sooner than it seems like I actually am going to be so this seems reasonable for the time being

@bors
Copy link
Collaborator

bors commented Nov 10, 2025

📌 Commit 6ed469c has been approved by BoxyUwU

It is now in the queue for this repository.

@bors bors 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 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-inherent_associated_types `#![feature(inherent_associated_types)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

Development

Successfully merging this pull request may close these issues.

4 participants