about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-01 07:42:48 -0700
committerGitHub <noreply@github.com>2020-07-01 07:42:48 -0700
commit3951a98ec5a53e527f0b2d1791b3db31738a107a (patch)
tree216db3a39320623b400a2edd44460f3472d841ee /src/libstd
parent8ac17d14aabddc660dafdc8b385bf7e6cd6e2bad (diff)
parentb71a3e1e3a20e7db3b8167d19002c372ffe69c54 (diff)
downloadrust-3951a98ec5a53e527f0b2d1791b3db31738a107a.tar.gz
rust-3951a98ec5a53e527f0b2d1791b3db31738a107a.zip
Rollup merge of #73752 - TyPR124:invalid-parameter-error, r=LukasKalbertodt
Remap Windows ERROR_INVALID_PARAMETER to ErrorKind::InvalidInput from Other

I don't know if this is acceptable or how likely it is to break existing code, but it seem to me ERROR_INVALID_PARAMETER "The parameter is incorrect" should map to ErrorKind::InvalidInput "A parameter was incorrect". Previously this value fell through to ErrorKind::Other.

I can't speak for anyone but myself, but I instinctively thought it would be InvalidInput.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sys/windows/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs
index 640c9f3636d..193ab5b47ef 100644
--- a/src/libstd/sys/windows/mod.rs
+++ b/src/libstd/sys/windows/mod.rs
@@ -61,6 +61,7 @@ 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_INVALID_PARAMETER => return ErrorKind::InvalidInput,
         c::ERROR_SEM_TIMEOUT
         | c::WAIT_TIMEOUT
         | c::ERROR_DRIVER_CANCEL_TIMEOUT