rust-lang / rust-analyzer

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

type mismatch with equal types in async function #14488

Open griffi-gh opened 1 year ago

griffi-gh commented 1 year ago

expected impl Future<Output = (StatusCode, Json)>, found impl Future<Output = (StatusCode, Json)>

VSCodium_Y81nKLcx4u

Crate compiles without any issues.

rust-analyzer version: rust-analyzer version: 0.4.1462-standalone (e87154017 2023-04-04)

rustc version: rustc 1.70.0-nightly (7820b62d2 2023-03-05)

(also tested on rustc 1.70.0-nightly (cf7ada217 2023-04-03))

relevant settings: -

HKalbasi commented 1 year ago

This one is strange to me, and I can't reproduce it with simple samples. Do you see the error if you replace your async fn with a simple fn which returns an impl Future? And would rustc accept your code in that case?

griffi-gh commented 1 year ago

And would rustc accept your code in that case?
Crate compiles without any issues.

Right now rustc accepts it, rust-analyzer doesn't.
I can try adding impl Future later
I can also just link the commit at which this issue happens, I just started the project so it's pretty small and the issue should be easy to isolate

HKalbasi commented 1 year ago

I can also just link the commit at which this issue happens

That would be great.

adrianncovaci commented 1 year ago

Got the same problem using version: rust-analyzer 0.3.1463-standalone (236576227 2023-04-02)

image
HKalbasi commented 1 year ago

@adrianncovaci That is #14479

jplatte commented 1 year ago

Should be fixed by #14486.