Rollup merge of #130254 - GrigorenkoPV:QuotaExceeded, r=dtolnay

Stabilize `std::io::ErrorKind::QuotaExceeded`

Also drop "Filesystem" from its name.

See #130190 for more info.

FCP in #130190

cc #86442

r? `@dtolnay`
This commit is contained in:
Matthias Krüger 2024-12-06 21:21:04 +01:00 committed by GitHub
commit d0fe04e22b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 14 additions and 14 deletions

View File

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

View File

@ -335,7 +335,7 @@ fn kind_from_prim(ek: u32) -> Option<ErrorKind> {
WriteZero, WriteZero,
StorageFull, StorageFull,
NotSeekable, NotSeekable,
FilesystemQuotaExceeded, QuotaExceeded,
FileTooLarge, FileTooLarge,
ResourceBusy, ResourceBusy,
ExecutableFileBusy, ExecutableFileBusy,

View File

@ -71,7 +71,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
libc::ECONNREFUSED => ConnectionRefused, libc::ECONNREFUSED => ConnectionRefused,
libc::ECONNRESET => ConnectionReset, libc::ECONNRESET => ConnectionReset,
libc::EDEADLK => Deadlock, libc::EDEADLK => Deadlock,
libc::EDQUOT => FilesystemQuotaExceeded, libc::EDQUOT => QuotaExceeded,
libc::EEXIST => AlreadyExists, libc::EEXIST => AlreadyExists,
libc::EFBIG => FileTooLarge, libc::EFBIG => FileTooLarge,
libc::EHOSTUNREACH => HostUnreachable, libc::EHOSTUNREACH => HostUnreachable,

View File

@ -254,7 +254,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
libc::ECONNREFUSED => ConnectionRefused, libc::ECONNREFUSED => ConnectionRefused,
libc::ECONNRESET => ConnectionReset, libc::ECONNRESET => ConnectionReset,
libc::EDEADLK => Deadlock, libc::EDEADLK => Deadlock,
libc::EDQUOT => FilesystemQuotaExceeded, libc::EDQUOT => QuotaExceeded,
libc::EEXIST => AlreadyExists, libc::EEXIST => AlreadyExists,
libc::EFBIG => FileTooLarge, libc::EFBIG => FileTooLarge,
libc::EHOSTUNREACH => HostUnreachable, libc::EHOSTUNREACH => HostUnreachable,

View File

@ -113,7 +113,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
c::ERROR_WRITE_PROTECT => return ReadOnlyFilesystem, c::ERROR_WRITE_PROTECT => return ReadOnlyFilesystem,
c::ERROR_DISK_FULL | c::ERROR_HANDLE_DISK_FULL => return StorageFull, c::ERROR_DISK_FULL | c::ERROR_HANDLE_DISK_FULL => return StorageFull,
c::ERROR_SEEK_ON_DEVICE => return NotSeekable, 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_FILE_TOO_LARGE => return FileTooLarge,
c::ERROR_BUSY => return ResourceBusy, c::ERROR_BUSY => return ResourceBusy,
c::ERROR_POSSIBLE_DEADLOCK => return Deadlock, c::ERROR_POSSIBLE_DEADLOCK => return Deadlock,
@ -138,7 +138,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
c::WSAEHOSTUNREACH => HostUnreachable, c::WSAEHOSTUNREACH => HostUnreachable,
c::WSAENETDOWN => NetworkDown, c::WSAENETDOWN => NetworkDown,
c::WSAENETUNREACH => NetworkUnreachable, c::WSAENETUNREACH => NetworkUnreachable,
c::WSAEDQUOT => FilesystemQuotaExceeded, c::WSAEDQUOT => QuotaExceeded,
_ => Uncategorized, _ => Uncategorized,
} }

View File

@ -44,7 +44,7 @@ const UNIX_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = {
("ECONNREFUSED", ConnectionRefused), ("ECONNREFUSED", ConnectionRefused),
("ECONNRESET", ConnectionReset), ("ECONNRESET", ConnectionReset),
("EDEADLK", Deadlock), ("EDEADLK", Deadlock),
("EDQUOT", FilesystemQuotaExceeded), ("EDQUOT", QuotaExceeded),
("EEXIST", AlreadyExists), ("EEXIST", AlreadyExists),
("EFBIG", FileTooLarge), ("EFBIG", FileTooLarge),
("EHOSTUNREACH", HostUnreachable), ("EHOSTUNREACH", HostUnreachable),