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

#[derive(PartialEq, Eq)] for nix::Errno? #487

Closed
dpc opened this issue Dec 9, 2016 · 1 comment
Closed

#[derive(PartialEq, Eq)] for nix::Errno? #487

dpc opened this issue Dec 9, 2016 · 1 comment

Comments

@dpc
Copy link

dpc commented Dec 9, 2016

match nix::unistd::read(*self.stdio.stdin.get_ref().0, self.buf) {
    Err(nix::Error::Sys(nix::errno::EWOULDBLOCK)) => {
    ...
    },
    ...
}

produces:

src/lib.rs|84 col 37 warning| to use a constant of type `nix::Errno` in a pattern, `nix::Errno` must be annotated with `#[derive(PartialEq, Eq)]`, #[warn(illegal_struct_or_e
num_constant_pattern)] on by default                                                                                                                                         
|| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!                                                    
|| for more information, see RFC 1445 <https://github.com/rust-lang/rfcs/pull/1445>  

I'm not exactly sure if I do the matching the best way.

@Susurrus
Copy link
Contributor

Susurrus commented Dec 5, 2017

Errno already implemented PartialEq, but Eq will be added by #807. Until that's merged, though, we'll leave this issue open.

bors bot added a commit that referenced this issue Dec 8, 2017
807: Switch to libc definitons of errno constants r=Susurrus a=Susurrus

Still need to do OpenBSD and NetBSD. Primary goal with this first pass is to see what doesn't exist properly in `libc`.

Closes #487.
@bors bors bot closed this as completed in #807 Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants