Skip to content

Conversation

@Amanieu
Copy link
Member

@Amanieu Amanieu commented Feb 6, 2026

This makes type-level name resolution (used primarily for associated types) also prefer subtrait items to supertrait items in case of ambiguity.

This addresses the concern from #148605 about the inconsistency with name resolution in expressions and method calls.

@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 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 Feb 6, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2026

r? @madsmtm

rustbot has assigned @madsmtm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • People who recently interacted with files modified in this PR: compiler
  • compiler expanded to 20 candidates
  • Random selection from 12 candidates

println!("{}", size_of::<T::T>());
}

fn generic2<T: C<T = i16>>() {
Copy link
Member

Choose a reason for hiding this comment

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

What about T: B<T = i16> and T: A<T = i8> - do those resolve to B::T and A::T respectively?

Also, please use a different name for the generic and the associated type, it's a bit confusing as-is.

@jackh726
Copy link
Member

jackh726 commented Feb 9, 2026

r? types

@rustbot rustbot added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Feb 9, 2026
@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-lang-radar Items that are on lang's radar and will need eventual work or consideration. 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. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants