Skip to content

Add io::ErrorKind::InputOutputError#159070

Open
valentynkit wants to merge 1 commit into
rust-lang:mainfrom
valentynkit:io-error-input-output-error
Open

Add io::ErrorKind::InputOutputError#159070
valentynkit wants to merge 1 commit into
rust-lang:mainfrom
valentynkit:io-error-input-output-error

Conversation

@valentynkit

@valentynkit valentynkit commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Adds an unstable io::ErrorKind::InputOutputError for low-level I/O failures.

EIO currently decodes to ErrorKind::Uncategorized, so stable code cannot tell that an operation failed at the low-level I/O layer without inspecting raw_os_error() and a platform-specific libc/windows-sys constant.

Implements the accepted ACP rust-lang/libs-team#824. The variant name is still open for bikeshedding before stabilization (see the ACP); this uses InputOutputError as accepted for now.

The variant maps:

  • EIO on Unix, WASI, and teeos
  • ERROR_IO_DEVICE on Windows
  • FR_DISK_ERR on VEXos

I didn't add a test, since the decode tables don't have one today (same as #158326).

Tracking issue: #159066

r? libs

`EIO` decoded to `ErrorKind::Uncategorized`, so a low-level I/O
failure could only be detected through `raw_os_error()`. Map it, and
the equivalent codes on Windows (`ERROR_IO_DEVICE`) and VEXos
(`FR_DISK_ERR`), to a new unstable `InputOutputError` variant.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants