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

Add Rust toolchain file #73

Closed

Conversation

64kramsystem
Copy link
Member

This doesn't affect devs who use stable by default, but helps those who use other toolchains (ie. nightly).

There is a nice side-effect in making it clear that this project expects stable, and also prevents devs from inadvertly work on nightly.

@zicklag
Copy link
Member

zicklag commented Jul 12, 2022

Using nightly compilers has actually been recommended for better compile times before, so I wonder if there is any reason to avoid working with nightly? Nightly is often my default.

I don't think that nightly rust allows you to do anything that you can't do on stable unless you explicitly enable unstable features in the source code. We could even block that with #![forbid(unstable_features)] maybe.

The only think I could think of that might cause some discrepancy would maybe be that the warnings you get could vary between compiler versions and clippy messages might be different.

@64kramsystem
Copy link
Member Author

Oh ok, I'm fine with anything. From the discussion on the channel I thought that this project was intended to be developed on stable only, but I misunderstood. I think blocking unstable features would be a good idea, just to have somewhere, in the project, that makes it clear and enforces, what's the intended target.

@zicklag
Copy link
Member

zicklag commented Jul 12, 2022

Well I'm not on the discussion channel so there could still be something I missed. :)

@64kramsystem
Copy link
Member Author

Well I'm not on the discussion channel so there could still be something I missed. :)

It was just about what's the official toolchain. The answer is stable, but that's not mutually exclusive, as you pointed out, with developing on nightly.

Interestingly, it seems that RA is more likely to break on nightly Rust versions (see here), but this is something that concerns the individual dev's setup (=me), not the team. I'm unlucky that RA breaks on my system, with the current and previous nightly! 🤬🤬

@64kramsystem 64kramsystem deleted the add_rust_toolchain_file branch July 12, 2022 21:36
@64kramsystem
Copy link
Member Author

@zicklag just out of curiosity, do you experience the bug I describe here on your setup (nightly)?

@zicklag
Copy link
Member

zicklag commented Jul 12, 2022

Oh, actually, I've like never had rust analyzer properly infer the types on query iterations. I didn't realize it was related to nightly. I thought I'd tried it on stable before and it didn't work either so I thought it was just a temporary limitation.

I'll have to try on stable. I've even ended up annotating the types in the code before just to make RA work so that it was easier to work with.

@zicklag
Copy link
Member

zicklag commented Jul 12, 2022

Look at that, it works on stable! Looks like I'll be using stable for now, then. :) Thanks for the tip!

@bayou-brogrammer
Copy link
Contributor

I know this issue is closed, but how did yall solve it? I switched to stable rust, and cleared my system of RA and then reinstalled via VSCode. It still doesn't infer types for bevy. What is weird is it infers types for internal things like Entity, but not my components.
CleanShot 2022-07-15 at 14 38 05@2x
CleanShot 2022-07-15 at 14 38 11@2x
CleanShot 2022-07-15 at 14 38 14@2x

@64kramsystem
Copy link
Member Author

I know this issue is closed, but how did yall solve it?

On my setup, I just had to move to stable 😬 I suggest to open an issue on the RA issue tracker - they may at least give you some pointers.

@zicklag
Copy link
Member

zicklag commented Jul 15, 2022

Yeah, same here. All I did was rustup override set stable in the workspace, cargo clean and then restart vscode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants