From 358adafa279ff3e6898ed49f4a2140144f121e9c Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 24 Jul 2021 14:43:02 -0600 Subject: Mark most C-derived enums as non_exhaustive Since libc may add new variants at any time, Nix's consumers should not use exhaustive match patterns. Fixes #1182 --- src/sys/signal.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sys/signal.rs') diff --git a/src/sys/signal.rs b/src/sys/signal.rs index 273b3521..b1d938c3 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -23,6 +23,7 @@ libc_enum!{ // We would prefer to use the libc::c_int alias in the repr attribute. Unfortunately // this is not (yet) possible. #[repr(i32)] + #[non_exhaustive] pub enum Signal { SIGHUP, SIGINT, @@ -396,6 +397,7 @@ libc_bitflags!{ libc_enum! { #[repr(i32)] + #[non_exhaustive] pub enum SigmaskHow { SIG_BLOCK, SIG_UNBLOCK, -- cgit v1.2.3