summaryrefslogtreecommitdiff
path: root/src/sys/termios.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-07-24 14:43:02 -0600
committerAlan Somers <asomers@gmail.com>2021-07-24 14:44:11 -0600
commit358adafa279ff3e6898ed49f4a2140144f121e9c (patch)
treed58fefacd019389f5131ea6a3c11b502fdcee276 /src/sys/termios.rs
parent7033d470d000a35236f157258c13dd50bc64725a (diff)
downloadnix-358adafa279ff3e6898ed49f4a2140144f121e9c.zip
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
Diffstat (limited to 'src/sys/termios.rs')
-rw-r--r--src/sys/termios.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sys/termios.rs b/src/sys/termios.rs
index 9abae9d0..b29d3b98 100644
--- a/src/sys/termios.rs
+++ b/src/sys/termios.rs
@@ -256,6 +256,7 @@ libc_enum!{
/// B0 is special and will disable the port.
#[cfg_attr(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64"), repr(u64))]
#[cfg_attr(not(all(any(target_os = "ios", target_os = "macos"), target_pointer_width = "64")), repr(u32))]
+ #[non_exhaustive]
pub enum BaudRate {
B0,
B50,
@@ -472,6 +473,7 @@ libc_enum! {
///
/// Used as an argument to `tcsetattr()`
#[repr(i32)]
+ #[non_exhaustive]
pub enum SetArg {
/// The change will occur immediately
TCSANOW,
@@ -487,6 +489,7 @@ libc_enum! {
///
/// Used as an argument to `tcflush()`.
#[repr(i32)]
+ #[non_exhaustive]
pub enum FlushArg {
/// Flush data that was received but not read
TCIFLUSH,
@@ -502,6 +505,7 @@ libc_enum! {
///
/// Used as an argument to `tcflow()`.
#[repr(i32)]
+ #[non_exhaustive]
pub enum FlowArg {
/// Suspend transmission
TCOOFF,
@@ -518,6 +522,7 @@ libc_enum! {
libc_enum! {
/// Indices into the `termios.c_cc` array for special characters.
#[repr(usize)]
+ #[non_exhaustive]
pub enum SpecialCharacterIndices {
VDISCARD,
#[cfg(any(target_os = "dragonfly",