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

support deriving Pod for packed generic types. #123

Merged
merged 3 commits into from
Aug 7, 2022

Conversation

Freax13
Copy link
Contributor

@Freax13 Freax13 commented Aug 7, 2022

This pr improves parsing of the repr attribute in derive macros and adds support for deriving Pod for generic packed types.

Closes #70

@Freax13
Copy link
Contributor Author

Freax13 commented Aug 7, 2022

What's the reason for 6632bce? Specifying a local path as well as a version would ensure that the tests are run against the local sources. This currently causes CI to fail because the tests use the published version of bytemuck_derive.

@Lokathor
Copy link
Owner

Lokathor commented Aug 7, 2022

What's the reason for 6632bce? Specifying a local path as well as a version would ensure that the tests are run against the local sources. This currently causes CI to fail because the tests use the published version of bytemuck_derive.

oh? I don't really use sub-folder projects and i was just trying to get things to work at all. If there's a better way i'm happy to have it.

@Freax13
Copy link
Contributor Author

Freax13 commented Aug 7, 2022

What's the reason for 6632bce? Specifying a local path as well as a version would ensure that the tests are run against the local sources. This currently causes CI to fail because the tests use the published version of bytemuck_derive.

oh? I don't really use sub-folder projects and i was just trying to get things to work at all. If there's a better way i'm happy to have it.

AFAIK just reverting the commit should work. See the relevant cargo documention here.

Should I open a separate pr for this?

@Lokathor
Copy link
Owner

Lokathor commented Aug 7, 2022

naw just fix it in this PR it's fine. as long as all the current files work i don't mind what the git history looks like.

This reverts commit 6632bce.
@Lokathor
Copy link
Owner

Lokathor commented Aug 7, 2022

Yandros approved it via discord, so i'm gonna merge it.

@Lokathor Lokathor merged commit 2c97676 into Lokathor:main Aug 7, 2022
@Freax13
Copy link
Contributor Author

Freax13 commented Aug 7, 2022

Yandros approved it via discord, so i'm gonna merge it.

May I ask which discord server you're using?

@Lokathor
Copy link
Owner

Lokathor commented Aug 7, 2022

leod pushed a commit to leod/bytemuck that referenced this pull request Jun 3, 2023
* improve `#[repr]` parsing

* allow deriving `Pod` for packed generic types

* Revert "Update Cargo.toml"

This reverts commit 587f3b9.
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.

Pod derive should work for generic types with #[repr(C, packed)]
2 participants