Skip to content

Commit 0a7e63a

Browse files
committed
Add comment about multiple errors to one ErrorKind
1 parent 6af006e commit 0a7e63a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tools/miri/src/shims/io_error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ const UNIX_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = {
8282
// <https://github.com/rust-lang/rust/blob/master/library/std/src/sys/pal/windows/mod.rs>.
8383
const WINDOWS_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = {
8484
use std::io::ErrorKind::*;
85+
// It's common for multiple error codes to map to the same io::ErrorKind. We have all for the
86+
// forwards mapping; only the first one will be used for the backwards mapping.
87+
// Slightly arbitrarily, we prefer non-WSA and the most generic sounding variant for backwards
88+
// mapping.
8589
&[
8690
("WSAEADDRINUSE", AddrInUse),
8791
("WSAEADDRNOTAVAIL", AddrNotAvailable),

0 commit comments

Comments
 (0)