-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Destructured tuple types not inferred correctly #12819
Comments
From the looks of it the problem is the |
Actually your snippet doesn't compile for me at all as |
Sorry I have included a more extensive code example. Position and archetype are both custom component strictly that I defined elsewhere. The code compiles and runs just fine on my system, it's just the type inference that is off. Inference also works if the query includes just a single component instead of a tuple. |
A reproducible snippet would be welcome, @yngwi is your problem also dependent on the toolchain, that is does the toolchain that was posted here fix the problem for you? |
Hi, I have set the rust toolchain in my project folder as suggested and now see the correct types in VSCode. So this indeed seems to be the cause of the problem. |
Alright, will investigate then, I assume some lang items/unstable traits changed in nightly that are relevant here |
It might just be proc macro expansion? @yngwi does it still work with the older toolchain if you set |
Oh right, that is most likely it 🤦 |
After changing this setting it doesn't work any more |
Yeah, that means this is just caused by proc macro support currently being broken on nightly, i.e. #12600. This should be fixed with the next stable release of rust-analyzer, or you could try the pre-release version. |
Ok, thank you. |
When using a query in a Bevy system, destructured tuple values are not correctly infered but shown as
{unknown}
.Screenshot where
{unknown}
is shown:rust-analyzer version:rust-analyzer version: 0.3.1131-standalone (897a7ec 2022-07-17)
rustc version: rustc 1.64.0-nightly (46b8c23f3 2022-07-01)
The text was updated successfully, but these errors were encountered: