Skip to content

Trait cannot solve Self assoc types #20756

@A4-Tacks

Description

@A4-Tacks

rust-analyzer version: rust-analyzer 0.4.2629-standalone

rustc version: rustc 1.91.0-nightly (040a98a 2025-08-20)

editor or extension: Vim

code snippet to reproduce:

trait Bar {
    type Item;
}
trait Foo<T: Bar>: Bar
where
    Self::Item: Bar,
    T::Item: Bar,
{}

Cursor on Item in Self::Item, hover not found

But cursor on Item in T::Item, hover is type Item

And Self::$0 cannot completion

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions