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 inference issue in Diesel #14374

Closed
AJTJ opened this issue Mar 18, 2023 · 4 comments
Closed

Type inference issue in Diesel #14374

AJTJ opened this issue Mar 18, 2023 · 4 comments
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug

Comments

@AJTJ
Copy link

AJTJ commented Mar 18, 2023

Type inference is not happening correctly, all the time, when using Diesel.

for example, with:

use trading_bot::schema::users::dsl::*;
let x = users.select(OutUser::as_select()).load(&mut conn);

for this, x is clearly of type Result<Vec<OutUser>, Error>, but rust-analyzer is identifying it as "unknown".
Screenshot 2023-03-18 at 10 46 14 AM

I have a feeling that rust-analyzer is probably struggling with how the generics are being created in diesel.

I really like rust-analyzer as a project. Is there something I can help with?

rust-analyzer version: 0.4.1438-standalone (924d277 2023-03-15)
rustc 1.69.0-nightly (31f858d9a 2023-02-28)

@AJTJ AJTJ added the C-bug Category: bug label Mar 18, 2023
@Veykril
Copy link
Member

Veykril commented Mar 28, 2023

Assuming its possible with your project but can you check whether using the master branch of diesel fixes this issue for you? I believe this is due to their proc-macros using an old edition which r-a struggles with.

@weiznich
Copy link
Contributor

Yes this specific case should be worked around by diesel-rs/diesel#3564

@weiznich
Copy link
Contributor

This is not fixed as shown by #14607

@lowr lowr added the A-ty type system / type inference / traits / method resolution label May 9, 2023
@lowr
Copy link
Contributor

lowr commented May 9, 2023

Let's close this one in favor of #14607. Thanks for the initial report!

@lowr lowr closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2023
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

4 participants