Remove NonZeroDWORD · model-checking/verify-rust-std@aa45985 (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
7 7
8 8 use crate::ffi::CStr;
9 9 use crate::mem;
10 -use crate::num::NonZero;
11 10 pub use crate::os::raw::c_int;
12 11 use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort, c_void};
13 12 use crate::os::windows::io::{AsRawHandle, BorrowedHandle};
@@ -19,7 +18,6 @@ mod windows_sys;
19 18 pub use windows_sys::*;
20 19
21 20 pub type DWORD = c_ulong;
22 -pub type NonZeroDWORD = NonZero<c_ulong>;
23 21 pub type LARGE_INTEGER = c_longlong;
24 22 #[cfg_attr(target_vendor = "uwp", allow(unused))]
25 23 pub type LONG = c_long;
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ use crate::path::{Path, PathBuf};
19 19 use crate::ptr;
20 20 use crate::sync::Mutex;
21 21 use crate::sys::args::{self, Arg};
22 -use crate::sys::c::{self, NonZeroDWORD, EXIT_FAILURE, EXIT_SUCCESS};
22 +use crate::sys::c::{self, EXIT_FAILURE, EXIT_SUCCESS};
23 23 use crate::sys::cvt;
24 24 use crate::sys::fs::{File, OpenOptions};
25 25 use crate::sys::handle::Handle;
@@ -717,7 +717,7 @@ pub struct ExitStatus(c::DWORD);
717 717
718 718 impl ExitStatus {
719 719 pub fn exit_ok(&self) -> Result<(), ExitStatusError> {
720 -match NonZeroDWORD::try_from(self.0) {
720 +match NonZero::<u32>::try_from(self.0) {
721 721 /* was nonzero */ Ok(failure) => Err(ExitStatusError(failure)),
722 722 /* was zero, couldn't convert */ Err(_) => Ok(()),
723 723 }
@@ -750,7 +750,7 @@ impl fmt::Display for ExitStatus {
750 750 }
751 751
752 752 #[derive(PartialEq, Eq, Clone, Copy, Debug)]
753 -pub struct ExitStatusError(c::NonZeroDWORD);
753 +pub struct ExitStatusError(NonZero<u32>);
754 754
755 755 impl Into<ExitStatus> for ExitStatusError {
756 756 fn into(self) -> ExitStatus {