Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type mismatch with equal types in async function #14488

Open
griffi-gh opened this issue Apr 4, 2023 · 6 comments
Open

type mismatch with equal types in async function #14488

griffi-gh opened this issue Apr 4, 2023 · 6 comments
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug

Comments

@griffi-gh
Copy link

griffi-gh commented Apr 4, 2023

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 (e871540 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: -

@griffi-gh griffi-gh added the C-bug Category: bug label Apr 4, 2023
@griffi-gh griffi-gh changed the title expected impl Future<Output = (StatusCode, Json<Value>)>, found impl Future<Output = (StatusCode, Json<Value>)> type mismatch with equal types Apr 4, 2023
@griffi-gh griffi-gh changed the title type mismatch with equal types type mismatch with equal types in async function Apr 4, 2023
@HKalbasi
Copy link
Member

HKalbasi commented Apr 4, 2023

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
Copy link
Author

griffi-gh commented Apr 4, 2023

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
Copy link
Member

HKalbasi commented Apr 4, 2023

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

That would be great.

@Veykril Veykril added the A-ty type system / type inference / traits / method resolution label Apr 5, 2023
@adrianncovaci
Copy link

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

image

@HKalbasi
Copy link
Member

HKalbasi commented Apr 5, 2023

@adrianncovaci That is #14479

@jplatte
Copy link
Contributor

jplatte commented Apr 6, 2023

Should be fixed by #14486.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

5 participants