rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.08k stars 1.57k forks source link

type inference unknown on GATs #17725

Open A4-Tacks opened 1 month ago

A4-Tacks commented 1 month ago

rust-analyzer version: rust-analyzer 1.80.0 (05147895 2024-07-21)

rustc version: rustc 1.80.0 (051478957 2024-07-21)

relevant settings: NONE

code snippet to reproduce:

trait Ptr: Sized {
    type T;
    type P<U>: Ptr<T = U>;

    fn pack(value: Self::T) -> Self;

    fn unpack(self) -> Self::T;

    fn to<U>(self) -> Self::P<U>
    where Self::T: Into<U>,
    {
        let new = self.unpack(); // let new: {unknown}
                                 // expected: let new: <Self as Ptr>::T
        Ptr::pack(new.into())
    }
}

fn main() {
}
ShoyuVanilla commented 1 month ago

Seems to be a chalk issue

ShoyuVanilla commented 1 month ago

I've tried some not so much destructive changes in chalk but they all broke many tests. I hope we can move into next-gen solver soon 🥲