Skip to content

Commit

Permalink
Rollup merge of rust-lang#73752 - TyPR124:invalid-parameter-error, r=…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Manishearth authored Jul 1, 2020
2 parents ac96594 + b71a3e1 commit 2ef0272
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/sys/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2ef0272

Please sign in to comment.