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/aio.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sys/aio.rs') diff --git a/src/sys/aio.rs b/src/sys/aio.rs index b63affb8..71a2184d 100644 --- a/src/sys/aio.rs +++ b/src/sys/aio.rs @@ -39,6 +39,7 @@ libc_enum! { /// Mode for `AioCb::fsync`. Controls whether only data or both data and /// metadata are synced. #[repr(i32)] + #[non_exhaustive] pub enum AioFsyncMode { /// do it like `fsync` O_SYNC, @@ -57,6 +58,7 @@ libc_enum! { /// given `aiocb` should be used for a read operation, a write operation, or /// ignored. Has no effect for any other aio functions. #[repr(i32)] + #[non_exhaustive] pub enum LioOpcode { LIO_NOP, LIO_WRITE, -- cgit v1.2.3