-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feature request: allow packed types #1704
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-type-system
Area: Type system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
While I do think we should support this in the language, you could probably hack around the problem with unsafe pointers. |
bnoordhuis
added a commit
to bnoordhuis/rust-epoll
that referenced
this issue
Feb 6, 2012
The kernel expects a packed (no holes) epoll_event struct but Rust doesn't support packed types yet. Depends on rust-lang/rust#1704.
I'm ok taking a patch to add |
huonw
added a commit
to huonw/rust
that referenced
this issue
Apr 9, 2013
A struct (inc. tuple struct) can be annotated with #[packed], so that there is no padding between its elements, like GCC's `__attribute__((packed))`. Closes rust-lang#1704.
huonw
added a commit
to huonw/rust
that referenced
this issue
Apr 10, 2013
A struct (inc. tuple struct) can be annotated with #[packed], so that there is no padding between its elements, like GCC's `__attribute__((packed))`. Closes rust-lang#1704
Fixed by cad2260 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-type-system
Area: Type system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Would it be possible to add support for packed types? Types appear to be unpacked right now (which is fine in itself) but it blocks interop with C APIs like
epoll_wait
.Example: on x86_64,
(0u32, 0u64)
is 12 bytes when packed and 16 bytes when unpacked.The text was updated successfully, but these errors were encountered: