Skip to content

setgroups type mismatches on Solaris #1986

Closed
@gco

Description

@gco

Building Rust 1.67.0 on Solaris x64, there's a typo from issue #1394 in the list of operating systems above this and illumos is included twice, one of them needs to be solaris.

error[E0308]: mismatched types
    --> /pool/projects/rust/rust-1.67.0/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.22.3/src/unistd.rs:1497:25
     |
1497 |         libc::setgroups(groups.len() as setgroups_ngroups_t, groups.as_ptr() as *const gid_t)
     |         --------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `usize`
     |         |
     |         arguments to this function are incorrect
     |
note: function defined here
    --> /pool/projects/rust/rust-1.67.0/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.135/src/unix/solarish/mod.rs:2727:12
     |
2727 |     pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
     |            ^^^^^^^^^
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
     |
1497 |         libc::setgroups((groups.len() as setgroups_ngroups_t).try_into().unwrap(), groups.as_ptr() as *const gid_t)
     |                         +                                   +++++++++++++++++++++

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