Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize std::io::ErrorKind::QuotaExceeded #130254

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions library/std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ pub enum ErrorKind {
/// example, on Unix, a named pipe opened with `File::open`.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
NotSeekable,
/// Filesystem quota was exceeded.
#[unstable(feature = "io_error_more", issue = "86442")]
FilesystemQuotaExceeded,
/// Filesystem quota or some other kind of quota was exceeded.
#[stable(feature = "io_error_quota_exceeded", since = "CURRENT_RUSTC_VERSION")]
QuotaExceeded,
/// File larger than allowed or supported.
///
/// This might arise from a hard limit of the underlying filesystem or file access API, or from
Expand Down Expand Up @@ -435,8 +435,8 @@ pub enum ErrorKind {
impl ErrorKind {
pub(crate) fn as_str(&self) -> &'static str {
use ErrorKind::*;
// tidy-alphabetical-start
match *self {
// tidy-alphabetical-start
AddrInUse => "address in use",
AddrNotAvailable => "address not available",
AlreadyExists => "entity already exists",
Expand All @@ -449,12 +449,11 @@ impl ErrorKind {
Deadlock => "deadlock",
DirectoryNotEmpty => "directory not empty",
ExecutableFileBusy => "executable file busy",
FileTooLarge => "file too large",
FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
FilesystemQuotaExceeded => "filesystem quota exceeded",
FileTooLarge => "file too large",
HostUnreachable => "host unreachable",
Interrupted => "operation interrupted",
InProgress => "in progress",
Interrupted => "operation interrupted",
InvalidData => "invalid data",
InvalidFilename => "invalid filename",
InvalidInput => "invalid input parameter",
Expand All @@ -468,6 +467,7 @@ impl ErrorKind {
Other => "other error",
OutOfMemory => "out of memory",
PermissionDenied => "permission denied",
QuotaExceeded => "quota exceeded",
ReadOnlyFilesystem => "read-only filesystem or storage medium",
ResourceBusy => "resource busy",
StaleNetworkFileHandle => "stale network file handle",
Expand All @@ -479,8 +479,8 @@ impl ErrorKind {
Unsupported => "unsupported",
WouldBlock => "operation would block",
WriteZero => "write zero",
// tidy-alphabetical-end
}
// tidy-alphabetical-end
}
}

Expand Down
2 changes: 1 addition & 1 deletion library/std/src/io/error/repr_bitpacked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ fn kind_from_prim(ek: u32) -> Option<ErrorKind> {
WriteZero,
StorageFull,
NotSeekable,
FilesystemQuotaExceeded,
QuotaExceeded,
FileTooLarge,
ResourceBusy,
ExecutableFileBusy,
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/teeos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
libc::ECONNREFUSED => ConnectionRefused,
libc::ECONNRESET => ConnectionReset,
libc::EDEADLK => Deadlock,
libc::EDQUOT => FilesystemQuotaExceeded,
libc::EDQUOT => QuotaExceeded,
libc::EEXIST => AlreadyExists,
libc::EFBIG => FileTooLarge,
libc::EHOSTUNREACH => HostUnreachable,
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
libc::ECONNREFUSED => ConnectionRefused,
libc::ECONNRESET => ConnectionReset,
libc::EDEADLK => Deadlock,
libc::EDQUOT => FilesystemQuotaExceeded,
libc::EDQUOT => QuotaExceeded,
libc::EEXIST => AlreadyExists,
libc::EFBIG => FileTooLarge,
libc::EHOSTUNREACH => HostUnreachable,
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sys/pal/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
c::ERROR_WRITE_PROTECT => return ReadOnlyFilesystem,
c::ERROR_DISK_FULL | c::ERROR_HANDLE_DISK_FULL => return StorageFull,
c::ERROR_SEEK_ON_DEVICE => return NotSeekable,
c::ERROR_DISK_QUOTA_EXCEEDED => return FilesystemQuotaExceeded,
c::ERROR_DISK_QUOTA_EXCEEDED => return QuotaExceeded,
c::ERROR_FILE_TOO_LARGE => return FileTooLarge,
c::ERROR_BUSY => return ResourceBusy,
c::ERROR_POSSIBLE_DEADLOCK => return Deadlock,
Expand All @@ -138,7 +138,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
c::WSAEHOSTUNREACH => HostUnreachable,
c::WSAENETDOWN => NetworkDown,
c::WSAENETUNREACH => NetworkUnreachable,
c::WSAEDQUOT => FilesystemQuotaExceeded,
c::WSAEDQUOT => QuotaExceeded,

_ => Uncategorized,
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/io_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const UNIX_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = {
("ECONNREFUSED", ConnectionRefused),
("ECONNRESET", ConnectionReset),
("EDEADLK", Deadlock),
("EDQUOT", FilesystemQuotaExceeded),
("EDQUOT", QuotaExceeded),
("EEXIST", AlreadyExists),
("EFBIG", FileTooLarge),
("EHOSTUNREACH", HostUnreachable),
Expand Down
Loading