Skip to content

Commit f541ab2

Browse files
committed
Make cloudapi enums #[non_exhaustive]
1 parent ea505fd commit f541ab2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/libstd/sys/cloudabi/abi/cloudabi.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ include!("bitflags.rs");
121121
/// File or memory access pattern advisory information.
122122
#[repr(u8)]
123123
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
124+
#[non_exhaustive]
124125
pub enum advice {
125126
/// The application expects that it will not access the
126127
/// specified data in the near future.
@@ -140,12 +141,12 @@ pub enum advice {
140141
/// The application expects to access the specified data
141142
/// in the near future.
142143
WILLNEED = 6,
143-
#[doc(hidden)] _NonExhaustive = -1 as isize as u8,
144144
}
145145

146146
/// Enumeration describing the kind of value stored in [`auxv`](struct.auxv.html).
147147
#[repr(u32)]
148148
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
149+
#[non_exhaustive]
149150
pub enum auxtype {
150151
/// Base address of the binary argument data provided to
151152
/// [`proc_exec()`](fn.proc_exec.html).
@@ -210,12 +211,12 @@ pub enum auxtype {
210211
SYSINFO_EHDR = 262,
211212
/// Thread ID of the initial thread of the process.
212213
TID = 261,
213-
#[doc(hidden)] _NonExhaustive = -1 as isize as u32,
214214
}
215215

216216
/// Identifiers for clocks.
217217
#[repr(u32)]
218218
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
219+
#[non_exhaustive]
219220
pub enum clockid {
220221
/// The system-wide monotonic clock, which is defined as a
221222
/// clock measuring real time, whose value cannot be
@@ -232,7 +233,6 @@ pub enum clockid {
232233
REALTIME = 3,
233234
/// The CPU-time clock associated with the current thread.
234235
THREAD_CPUTIME_ID = 4,
235-
#[doc(hidden)] _NonExhaustive = -1 as isize as u32,
236236
}
237237

238238
/// A userspace condition variable.
@@ -267,6 +267,7 @@ pub const DIRCOOKIE_START: dircookie = dircookie(0);
267267
/// exclusively or merely provided for alignment with POSIX.
268268
#[repr(u16)]
269269
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
270+
#[non_exhaustive]
270271
pub enum errno {
271272
/// No error occurred. System call completed successfully.
272273
SUCCESS = 0,
@@ -422,7 +423,6 @@ pub enum errno {
422423
XDEV = 75,
423424
/// Extension: Capabilities insufficient.
424425
NOTCAPABLE = 76,
425-
#[doc(hidden)] _NonExhaustive = -1 as isize as u16,
426426
}
427427

428428
bitflags! {
@@ -438,6 +438,7 @@ bitflags! {
438438
/// Type of a subscription to an event or its occurrence.
439439
#[repr(u8)]
440440
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
441+
#[non_exhaustive]
441442
pub enum eventtype {
442443
/// The time value of clock [`subscription.union.clock.clock_id`](struct.subscription_clock.html#structfield.clock_id)
443444
/// has reached timestamp [`subscription.union.clock.timeout`](struct.subscription_clock.html#structfield.timeout).
@@ -463,7 +464,6 @@ pub enum eventtype {
463464
/// The process associated with process descriptor
464465
/// [`subscription.union.proc_terminate.fd`](struct.subscription_proc_terminate.html#structfield.fd) has terminated.
465466
PROC_TERMINATE = 7,
466-
#[doc(hidden)] _NonExhaustive = -1 as isize as u8,
467467
}
468468

469469
/// Exit code generated by a process when exiting.
@@ -530,6 +530,7 @@ pub type filesize = u64;
530530
/// The type of a file descriptor or file.
531531
#[repr(u8)]
532532
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
533+
#[non_exhaustive]
533534
pub enum filetype {
534535
/// The type of the file descriptor or file is unknown or
535536
/// is different from any of the other types specified.
@@ -558,7 +559,6 @@ pub enum filetype {
558559
SOCKET_STREAM = 130,
559560
/// The file refers to a symbolic link inode.
560561
SYMBOLIC_LINK = 144,
561-
#[doc(hidden)] _NonExhaustive = -1 as isize as u8,
562562
}
563563

564564
bitflags! {
@@ -847,12 +847,12 @@ bitflags! {
847847
/// memory.
848848
#[repr(u8)]
849849
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
850+
#[non_exhaustive]
850851
pub enum scope {
851852
/// The object is stored in private memory.
852853
PRIVATE = 4,
853854
/// The object is stored in shared memory.
854855
SHARED = 8,
855-
#[doc(hidden)] _NonExhaustive = -1 as isize as u8,
856856
}
857857

858858
bitflags! {
@@ -878,6 +878,7 @@ bitflags! {
878878
/// Signal condition.
879879
#[repr(u8)]
880880
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
881+
#[non_exhaustive]
881882
pub enum signal {
882883
/// Process abort signal.
883884
///
@@ -983,7 +984,6 @@ pub enum signal {
983984
///
984985
/// Action: Terminates the process.
985986
XFSZ = 26,
986-
#[doc(hidden)] _NonExhaustive = -1 as isize as u8,
987987
}
988988

989989
bitflags! {
@@ -1049,14 +1049,14 @@ pub type userdata = u64;
10491049
/// should be set.
10501050
#[repr(u8)]
10511051
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
1052+
#[non_exhaustive]
10521053
pub enum whence {
10531054
/// Seek relative to current position.
10541055
CUR = 1,
10551056
/// Seek relative to end-of-file.
10561057
END = 2,
10571058
/// Seek relative to start-of-file.
10581059
SET = 3,
1059-
#[doc(hidden)] _NonExhaustive = -1 as isize as u8,
10601060
}
10611061

10621062
/// Auxiliary vector entry.

0 commit comments

Comments
 (0)