Skip to content

Stabilize io_error_more #106375

New issue

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

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

Already on GitHub? # to your account

Closed
Closed
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
44 changes: 22 additions & 22 deletions library/std/src/io/error.rs
Original file line number Diff line number Diff line change
@@ -180,10 +180,10 @@ pub enum ErrorKind {
#[stable(feature = "rust1", since = "1.0.0")]
ConnectionReset,
/// The remote host is not reachable.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
HostUnreachable,
/// The network containing the remote host is not reachable.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
NetworkUnreachable,
/// The connection was aborted (terminated) by the remote server.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -200,7 +200,7 @@ pub enum ErrorKind {
#[stable(feature = "rust1", since = "1.0.0")]
AddrNotAvailable,
/// The system's networking is down.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
NetworkDown,
/// The operation failed because a pipe was closed.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -216,18 +216,18 @@ pub enum ErrorKind {
///
/// For example, a filesystem path was specified where one of the intermediate directory
/// components was, in fact, a plain file.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
NotADirectory,
/// The filesystem object is, unexpectedly, a directory.
///
/// A directory was specified when a non-directory was expected.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
IsADirectory,
/// A non-empty directory was specified where an empty directory was expected.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
DirectoryNotEmpty,
/// The filesystem or storage medium is read-only, but a write operation was attempted.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
ReadOnlyFilesystem,
/// Loop in the filesystem or IO subsystem; often, too many levels of symbolic links.
///
@@ -236,13 +236,13 @@ pub enum ErrorKind {
///
/// On Unix this is usually the result of a symbolic link loop; or, of exceeding the
/// system-specific limit on the depth of symlink traversal.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
FilesystemLoop,
/// Stale network file handle.
///
/// With some network filesystems, notably NFS, an open file (or directory) can be invalidated
/// by problems with the network or server.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
StaleNetworkFileHandle,
/// A parameter was incorrect.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -276,57 +276,57 @@ pub enum ErrorKind {
/// The underlying storage (typically, a filesystem) is full.
///
/// This does not include out of quota errors.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
StorageFull,
/// Seek on unseekable file.
///
/// Seeking was attempted on an open file handle which is not suitable for seeking - for
/// example, on Unix, a named pipe opened with `File::open`.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
NotSeekable,
/// Filesystem quota was exceeded.
#[unstable(feature = "io_error_more", issue = "86442")]
FilesystemQuotaExceeded,
#[stable(feature = "io_error_more", 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
/// an administratively imposed resource limitation. Simple disk full, and out of quota, have
/// their own errors.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
FileTooLarge,
/// Resource is busy.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
ResourceBusy,
/// Executable file is busy.
///
/// An attempt was made to write to a file which is also in use as a running program. (Not all
/// operating systems detect this situation.)
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
ExecutableFileBusy,
/// Deadlock (avoided).
///
/// A file locking operation would result in deadlock. This situation is typically detected, if
/// at all, on a best-effort basis.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
Deadlock,
/// Cross-device or cross-filesystem (hard) link or rename.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
CrossesDevices,
/// Too many (hard) links to the same filesystem object.
///
/// The filesystem does not support making so many hardlinks to the same file.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
TooManyLinks,
/// A filename was invalid.
///
/// This error can also cause if it exceeded the filename length limit.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
InvalidFilename,
/// Program argument list too long.
///
/// When trying to run an external program, a system or process limit on the size of the
/// arguments would have been exceeded.
#[unstable(feature = "io_error_more", issue = "86442")]
#[stable(feature = "io_error_more", since = "CURRENT_RUSTC_VERSION")]
ArgumentListTooLong,
/// This operation was interrupted.
///
@@ -403,7 +403,7 @@ impl ErrorKind {
ExecutableFileBusy => "executable file busy",
FileTooLarge => "file too large",
FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
FilesystemQuotaExceeded => "filesystem quota exceeded",
QuotaExceeded => "quota exceeded",
HostUnreachable => "host unreachable",
Interrupted => "operation interrupted",
InvalidData => "invalid data",
2 changes: 1 addition & 1 deletion library/std/src/io/error/repr_bitpacked.rs
Original file line number Diff line number Diff line change
@@ -326,7 +326,7 @@ fn kind_from_prim(ek: u32) -> Option<ErrorKind> {
WriteZero,
StorageFull,
NotSeekable,
FilesystemQuotaExceeded,
QuotaExceeded,
FileTooLarge,
ResourceBusy,
ExecutableFileBusy,
2 changes: 1 addition & 1 deletion library/std/src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
@@ -236,7 +236,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,
2 changes: 1 addition & 1 deletion library/std/src/sys/windows/mod.rs
Original file line number Diff line number Diff line change
@@ -99,7 +99,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,
2 changes: 1 addition & 1 deletion src/tools/miri/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -38,7 +38,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),
1 change: 0 additions & 1 deletion src/tools/miri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
#![feature(map_try_insert)]
#![feature(never_type)]
#![feature(try_blocks)]
#![feature(io_error_more)]
#![feature(variant_count)]
#![feature(yeet_expr)]
#![feature(is_some_and)]
1 change: 0 additions & 1 deletion src/tools/miri/tests/pass-dep/shims/libc-fs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ignore-target-windows: no libc on Windows
//@compile-flags: -Zmiri-disable-isolation

#![feature(io_error_more)]
#![feature(io_error_uncategorized)]

use std::convert::TryInto;
1 change: 0 additions & 1 deletion src/tools/miri/tests/pass-dep/shims/libc-misc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ignore-target-windows: No libc on Windows
//@compile-flags: -Zmiri-disable-isolation
#![feature(io_error_more)]

use std::fs::{remove_file, File};
use std::os::unix::io::AsRawFd;
1 change: 0 additions & 1 deletion src/tools/miri/tests/pass/shims/fs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ignore-target-windows: File handling is not implemented yet
//@compile-flags: -Zmiri-disable-isolation

#![feature(io_error_more)]
#![feature(io_error_uncategorized)]
#![feature(is_terminal)]