-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
[Merged by Bors] - Derive default for enums where possible #5158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in the PR look good. I didn't double check if there were any enums that were missed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. Less code is better code.
Thanks. Looks like I missed |
Of the 10 pub(crate) enums, only those two were relevant. |
bors r+ |
# Objective Fixes #5153 ## Solution Search for all enums and manually check if they have default impls that can use this new derive. By my reckoning: | enum | num | |-|-| | total | 159 | | has default impl | 29 | | default is unit variant | 23 |
examples on main are not compiling for me because of this, what should I do?
|
Update your Rust version using rustup update :) |
I've already done it:
|
That's very surprising. I would attempt cargo clean + deleting Cargo.lock + cargo update. If that still fails, I would attempt a minimal reproduction and file a bug with the Rustlang team. |
done all these steps and still( |
Hmm. Perhaps you're running Bevy with an old Rust version via some project specific configuration? I would try a fresh example project, where you just define a toy enum and use this feature. Either way, I would delete your Bevy folder and clone it again from scratch. |
sounds OK, I'll try, thanks |
a few commands to check your rust versions:
|
after some experiments in a minimal example I've realized that there are two versions of Rust on my mac - one is installed in a 'classic' manner and the other via brew package manager. for some reason when I run rustup/cargo --version command it is referring to classic which is brand new, but when I try to compile something it uses that brew version, meh. solution: brew uninstall rust |
# Objective Fixes bevyengine#5153 ## Solution Search for all enums and manually check if they have default impls that can use this new derive. By my reckoning: | enum | num | |-|-| | total | 159 | | has default impl | 29 | | default is unit variant | 23 |
# Objective Fixes bevyengine#5153 ## Solution Search for all enums and manually check if they have default impls that can use this new derive. By my reckoning: | enum | num | |-|-| | total | 159 | | has default impl | 29 | | default is unit variant | 23 |
# Objective Fixes bevyengine#5153 ## Solution Search for all enums and manually check if they have default impls that can use this new derive. By my reckoning: | enum | num | |-|-| | total | 159 | | has default impl | 29 | | default is unit variant | 23 |
Objective
Fixes #5153
Solution
Search for all enums and manually check if they have default impls that can use this new derive.
By my reckoning: