-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
changed marker struct to const generic parameter #18086
changed marker struct to const generic parameter #18086
Conversation
I like that the two options are exhaustively enumerated, but I don't like the const ALIGNED = true stuff. Maybe with const generic enums and |
I think you would be able to do |
Makes sense! Good to close it then? |
Objective
Fixes #18085.
Solution
Implementation as described in issue:
Aligned
andUnaligned
structs withALIGNED
andUNALIGNED
constantsA: IsAligned = Aligned
toconst IS_ALIGNED: bool = ALIGNED
inPtr
,PtrMut
andOwningPtr
Testing
cargo check --workspace --all-targets
passescargo test --workspace --all-targets
passesMigration Guide
bevy_ptr::Aligned
andbevy_ptr::Unaligned
in the context ofPtr
,PtrMut
andOwningPtr
withALIGNED
andUNALIGNED
, respectively.IsAligned
trait with a const generic parameter of type bool.