Skip to content

Commit

Permalink
Rollup merge of rust-lang#130789 - aviramha:add_inprogress, r=Noratrieb
Browse files Browse the repository at this point in the history
add InProgress ErrorKind gated behind io_error_inprogress feature

Follow up on rust-lang/libs-team#92 (comment)
  • Loading branch information
tgross35 authored Sep 24, 2024
2 parents 8849d13 + c86f1ce commit 2c408b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ pub enum ErrorKind {
#[stable(feature = "out_of_memory_error", since = "1.54.0")]
OutOfMemory,

/// The operation was partially successful and needs to be checked
/// later on due to not blocking.
#[unstable(feature = "io_error_inprogress", issue = "none")]
InProgress,

// "Unusual" error kinds which do not correspond simply to (sets
// of) OS error codes, should be added just above this comment.
// `Other` and `Uncategorized` should remain at the end:
Expand Down Expand Up @@ -449,6 +454,7 @@ impl ErrorKind {
FilesystemQuotaExceeded => "filesystem quota exceeded",
HostUnreachable => "host unreachable",
Interrupted => "operation interrupted",
InProgress => "in progress",
InvalidData => "invalid data",
InvalidFilename => "invalid filename",
InvalidInput => "invalid input parameter",
Expand Down
1 change: 1 addition & 0 deletions std/src/io/error/repr_bitpacked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ fn kind_from_prim(ek: u32) -> Option<ErrorKind> {
UnexpectedEof,
Unsupported,
OutOfMemory,
InProgress,
Uncategorized,
})
}
Expand Down
1 change: 1 addition & 0 deletions std/src/sys/pal/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
libc::ETIMEDOUT => TimedOut,
libc::ETXTBSY => ExecutableFileBusy,
libc::EXDEV => CrossesDevices,
libc::EINPROGRESS => InProgress,

libc::EACCES | libc::EPERM => PermissionDenied,

Expand Down

0 comments on commit 2c408b1

Please # to comment.