Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/libstd/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ pub enum ErrorKind {
#[stable(feature = "rust1", since = "1.0.0")]
Interrupted,
/// Any I/O error not part of this list.
///
/// Errors that are `Other` now may move to a different or a new
/// [`ErrorKind`] variant in the future. It is not recommended to match
/// an error against `Other` and to expect any additional characteristics,
/// e.g., a specific [`Error::raw_os_error`] return value.
#[stable(feature = "rust1", since = "1.0.0")]
Other,

Expand Down
17 changes: 15 additions & 2 deletions src/libstd/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,26 @@ pub const ERROR_FILE_EXISTS: DWORD = 80;
pub const ERROR_INVALID_PARAMETER: DWORD = 87;
pub const ERROR_BROKEN_PIPE: DWORD = 109;
pub const ERROR_CALL_NOT_IMPLEMENTED: DWORD = 120;
pub const ERROR_SEM_TIMEOUT: DWORD = 121;
pub const ERROR_INSUFFICIENT_BUFFER: DWORD = 122;
pub const ERROR_ALREADY_EXISTS: DWORD = 183;
pub const ERROR_NO_DATA: DWORD = 232;
pub const ERROR_ENVVAR_NOT_FOUND: DWORD = 203;
pub const ERROR_NO_DATA: DWORD = 232;
pub const ERROR_DRIVER_CANCEL_TIMEOUT: DWORD = 594;
pub const ERROR_OPERATION_ABORTED: DWORD = 995;
pub const ERROR_IO_PENDING: DWORD = 997;
pub const ERROR_TIMEOUT: DWORD = 0x5B4;
pub const ERROR_SERVICE_REQUEST_TIMEOUT: DWORD = 1053;
pub const ERROR_COUNTER_TIMEOUT: DWORD = 1121;
pub const ERROR_TIMEOUT: DWORD = 1460;
pub const ERROR_RESOURCE_CALL_TIMED_OUT: DWORD = 5910;
pub const ERROR_CTX_MODEM_RESPONSE_TIMEOUT: DWORD = 7012;
pub const ERROR_CTX_CLIENT_QUERY_TIMEOUT: DWORD = 7040;
pub const FRS_ERR_SYSVOL_POPULATE_TIMEOUT: DWORD = 8014;
pub const ERROR_DS_TIMELIMIT_EXCEEDED: DWORD = 8226;
pub const DNS_ERROR_RECORD_TIMED_OUT: DWORD = 9705;
pub const ERROR_IPSEC_IKE_TIMED_OUT: DWORD = 13805;
pub const ERROR_RUNLEVEL_SWITCH_TIMEOUT: DWORD = 15402;
pub const ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT: DWORD = 15403;

pub const E_NOTIMPL: HRESULT = 0x80004001u32 as HRESULT;

Expand Down
17 changes: 16 additions & 1 deletion src/libstd/sys/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,22 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
c::ERROR_FILE_NOT_FOUND => return ErrorKind::NotFound,
c::ERROR_PATH_NOT_FOUND => return ErrorKind::NotFound,
c::ERROR_NO_DATA => return ErrorKind::BrokenPipe,
c::ERROR_OPERATION_ABORTED => return ErrorKind::TimedOut,
c::ERROR_SEM_TIMEOUT |
c::WAIT_TIMEOUT |
c::ERROR_DRIVER_CANCEL_TIMEOUT |
c::ERROR_OPERATION_ABORTED |
c::ERROR_SERVICE_REQUEST_TIMEOUT |
c::ERROR_COUNTER_TIMEOUT |
c::ERROR_TIMEOUT |
c::ERROR_RESOURCE_CALL_TIMED_OUT |
c::ERROR_CTX_MODEM_RESPONSE_TIMEOUT |
c::ERROR_CTX_CLIENT_QUERY_TIMEOUT |
c::FRS_ERR_SYSVOL_POPULATE_TIMEOUT |
c::ERROR_DS_TIMELIMIT_EXCEEDED |
c::DNS_ERROR_RECORD_TIMED_OUT |
c::ERROR_IPSEC_IKE_TIMED_OUT |
c::ERROR_RUNLEVEL_SWITCH_TIMEOUT |
c::ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT => return ErrorKind::TimedOut,
_ => {}
}

Expand Down