Skip to content

Failing to build on DragonFly BSD because of incorrect casting #1238

Closed
@strangelittlemonkey

Description

@strangelittlemonkey

zach@test ~/user_test> cargo run
Updating registry https://github.com/rust-lang/crates.io-index
Downloading users v0.8.1
Downloading libc v0.2.48
Compiling libc v0.2.48
error[E0433]: failed to resolve. Use of undeclared type or module mem
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:798:33
|
798 | .offset(_CMSG_ALIGN(mem::size_of::<::cmsghdr>()) as isize)
| ^^^ Use of undeclared type or module mem

error[E0433]: failed to resolve. Use of undeclared type or module mem
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:802:21
|
802 | _CMSG_ALIGN(mem::size_of::<::cmsghdr>()) + length as usize
| ^^^ Use of undeclared type or module mem

error[E0433]: failed to resolve. Use of undeclared type or module mem
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:809:27
|
809 | + _CMSG_ALIGN(mem::size_of::<::cmsghdr>());
| ^^^ Use of undeclared type or module mem

error[E0433]: failed to resolve. Use of undeclared type or module mem
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:820:21
|
820 | _CMSG_ALIGN(mem::size_of::<::cmsghdr>()) + _CMSG_ALIGN(length as usize)
| ^^^ Use of undeclared type or module mem

error[E0308]: mismatched types
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:802:9
|
801 | pub fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
| -------- expected u32 because of return type
802 | _CMSG_ALIGN(mem::size_of::<::cmsghdr>()) + length as usize
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u32, found usize

error[E0308]: mismatched types
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:808:48
|
808 | let next = cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len)
| ^^^^^^^^^^^^^^^^ expected usize, found u32

error[E0308]: mismatched types
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:813:42
|
813 | (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len)) as *mut ::cmsghdr
| ^^^^^^^^^^^^^^^^ expected usize, found u32

error[E0308]: mismatched types
--> /home/zach/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.48/src/unix/bsd/freebsdlike/dragonfly/mod.rs:820:9
|
819 | pub fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
| -------- expected u32 because of return type
820 | _CMSG_ALIGN(mem::size_of::<::cmsghdr>()) + _CMSG_ALIGN(length as usize)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u32, found usize

error: aborting due to 8 previous errors

Some errors occurred: E0308, E0433.
For more information about an error, try rustc --explain E0308.
error: Could not compile libc.

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions