]> git.lizzy.rs Git - rust.git/commitdiff
Make cloudapi enums #[non_exhaustive]
authorvarkor <github@varkor.com>
Wed, 15 Aug 2018 15:58:53 +0000 (16:58 +0100)
committervarkor <github@varkor.com>
Wed, 15 Aug 2018 16:16:48 +0000 (17:16 +0100)
src/libstd/sys/cloudabi/abi/cloudabi.rs

index 2909db5098e58f58860d1c4ad4f1a6569706112a..cd9a5ad448f58c31b099818351b39f600b4c9f21 100644 (file)
 /// File or memory access pattern advisory information.
 #[repr(u8)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum advice {
   /// The application expects that it will not access the
   /// specified data in the near future.
@@ -140,12 +141,12 @@ pub enum advice {
   /// The application expects to access the specified data
   /// in the near future.
   WILLNEED   = 6,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u8,
 }
 
 /// Enumeration describing the kind of value stored in [`auxv`](struct.auxv.html).
 #[repr(u32)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum auxtype {
   /// Base address of the binary argument data provided to
   /// [`proc_exec()`](fn.proc_exec.html).
@@ -210,12 +211,12 @@ pub enum auxtype {
   SYSINFO_EHDR = 262,
   /// Thread ID of the initial thread of the process.
   TID          = 261,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u32,
 }
 
 /// Identifiers for clocks.
 #[repr(u32)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum clockid {
   /// The system-wide monotonic clock, which is defined as a
   /// clock measuring real time, whose value cannot be
@@ -232,7 +233,6 @@ pub enum clockid {
   REALTIME           = 3,
   /// The CPU-time clock associated with the current thread.
   THREAD_CPUTIME_ID  = 4,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u32,
 }
 
 /// A userspace condition variable.
@@ -267,6 +267,7 @@ pub enum clockid {
 /// exclusively or merely provided for alignment with POSIX.
 #[repr(u16)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum errno {
   /// No error occurred. System call completed successfully.
   SUCCESS        =  0,
@@ -422,7 +423,6 @@ pub enum errno {
   XDEV           = 75,
   /// Extension: Capabilities insufficient.
   NOTCAPABLE     = 76,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u16,
 }
 
 bitflags! {
@@ -438,6 +438,7 @@ pub struct eventrwflags: u16 {
 /// Type of a subscription to an event or its occurrence.
 #[repr(u8)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum eventtype {
   /// The time value of clock [`subscription.union.clock.clock_id`](struct.subscription_clock.html#structfield.clock_id)
   /// has reached timestamp [`subscription.union.clock.timeout`](struct.subscription_clock.html#structfield.timeout).
@@ -463,7 +464,6 @@ pub enum eventtype {
   /// The process associated with process descriptor
   /// [`subscription.union.proc_terminate.fd`](struct.subscription_proc_terminate.html#structfield.fd) has terminated.
   PROC_TERMINATE = 7,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u8,
 }
 
 /// Exit code generated by a process when exiting.
@@ -530,6 +530,7 @@ pub struct fdsflags: u16 {
 /// The type of a file descriptor or file.
 #[repr(u8)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum filetype {
   /// The type of the file descriptor or file is unknown or
   /// is different from any of the other types specified.
@@ -558,7 +559,6 @@ pub enum filetype {
   SOCKET_STREAM    = 130,
   /// The file refers to a symbolic link inode.
   SYMBOLIC_LINK    = 144,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u8,
 }
 
 bitflags! {
@@ -847,12 +847,12 @@ pub struct roflags: u16 {
 /// memory.
 #[repr(u8)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum scope {
   /// The object is stored in private memory.
   PRIVATE = 4,
   /// The object is stored in shared memory.
   SHARED  = 8,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u8,
 }
 
 bitflags! {
@@ -878,6 +878,7 @@ pub struct siflags: u16 {
 /// Signal condition.
 #[repr(u8)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum signal {
   /// Process abort signal.
   ///
@@ -983,7 +984,6 @@ pub enum signal {
   ///
   /// Action: Terminates the process.
   XFSZ   = 26,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u8,
 }
 
 bitflags! {
@@ -1049,6 +1049,7 @@ pub struct ulflags: u8 {
 /// should be set.
 #[repr(u8)]
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
+#[non_exhaustive]
 pub enum whence {
   /// Seek relative to current position.
   CUR = 1,
@@ -1056,7 +1057,6 @@ pub enum whence {
   END = 2,
   /// Seek relative to start-of-file.
   SET = 3,
-  #[doc(hidden)] _NonExhaustive = -1 as isize as u8,
 }
 
 /// Auxiliary vector entry.