-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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] - revert supporting generics for deriving TypeUuid #2204
Closed
NathanSWard
wants to merge
1
commit into
bevyengine:main
from
NathanSWard:nward/type-uuid-revent-generic-derive
Closed
[Merged by Bors] - revert supporting generics for deriving TypeUuid #2204
NathanSWard
wants to merge
1
commit into
bevyengine:main
from
NathanSWard:nward/type-uuid-revent-generic-derive
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NathanSWard
force-pushed
the
nward/type-uuid-revent-generic-derive
branch
from
May 17, 2021 19:44
6988479
to
d547322
Compare
NathanSWard
force-pushed
the
nward/type-uuid-revent-generic-derive
branch
from
May 17, 2021 19:50
d547322
to
9c32164
Compare
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
May 17, 2021
This reverts some of the changes made in #2044 as supporting generics for a `#[derive(TypeUuid)]` should not work as each generic instantiation would have the same uuid. Stems from [this conversation](#2044 (comment))
Pull request successfully merged into main. Build succeeded: |
bors
bot
changed the title
revert supporting generics for deriving TypeUuid
[Merged by Bors] - revert supporting generics for deriving TypeUuid
May 17, 2021
ostwilkens
pushed a commit
to ostwilkens/bevy
that referenced
this pull request
Jul 27, 2021
This reverts some of the changes made in bevyengine#2044 as supporting generics for a `#[derive(TypeUuid)]` should not work as each generic instantiation would have the same uuid. Stems from [this conversation](bevyengine#2044 (comment))
bors bot
pushed a commit
that referenced
this pull request
Apr 26, 2022
Support for deriving `TypeUuid` for types with generics was initially added in #2044 but later reverted #2204 because it lead to `MyStruct<A>` and `MyStruct<B>` having the same type uuid. This PR fixes this by generating code like ```rust #[derive(TypeUuid)] #[uuid = "69b09733-a21a-4dab-a444-d472986bd672"] struct Type<T>(T); impl<T: TypeUuid> TypeUuid for Type<T> { const TYPE_UUID: TypeUuid = generate_compound_uuid(Uuid::from_bytes([/* 69b0 uuid */]), T::TYPE_UUID); } ``` where `generate_compound_uuid` will XOR the non-metadata bits of the two UUIDs. Co-authored-by: XBagon <[email protected]> Co-authored-by: Jakob Hellermann <[email protected]>
exjam
pushed a commit
to exjam/bevy
that referenced
this pull request
May 22, 2022
Support for deriving `TypeUuid` for types with generics was initially added in bevyengine#2044 but later reverted bevyengine#2204 because it lead to `MyStruct<A>` and `MyStruct<B>` having the same type uuid. This PR fixes this by generating code like ```rust #[derive(TypeUuid)] #[uuid = "69b09733-a21a-4dab-a444-d472986bd672"] struct Type<T>(T); impl<T: TypeUuid> TypeUuid for Type<T> { const TYPE_UUID: TypeUuid = generate_compound_uuid(Uuid::from_bytes([/* 69b0 uuid */]), T::TYPE_UUID); } ``` where `generate_compound_uuid` will XOR the non-metadata bits of the two UUIDs. Co-authored-by: XBagon <[email protected]> Co-authored-by: Jakob Hellermann <[email protected]>
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this pull request
Feb 1, 2023
Support for deriving `TypeUuid` for types with generics was initially added in bevyengine#2044 but later reverted bevyengine#2204 because it lead to `MyStruct<A>` and `MyStruct<B>` having the same type uuid. This PR fixes this by generating code like ```rust #[derive(TypeUuid)] #[uuid = "69b09733-a21a-4dab-a444-d472986bd672"] struct Type<T>(T); impl<T: TypeUuid> TypeUuid for Type<T> { const TYPE_UUID: TypeUuid = generate_compound_uuid(Uuid::from_bytes([/* 69b0 uuid */]), T::TYPE_UUID); } ``` where `generate_compound_uuid` will XOR the non-metadata bits of the two UUIDs. Co-authored-by: XBagon <[email protected]> Co-authored-by: Jakob Hellermann <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts some of the changes made in #2044 as supporting generics for a
#[derive(TypeUuid)]
should not work as each generic instantiation would have the same uuid.Stems from this conversation