diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-05-27 14:03:35 +0200 | 
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-06-15 14:22:49 +0200 | 
| commit | 0b37bb2bc25be8059e88a4139d9ab067d9600610 (patch) | |
| tree | 94b924be8089b0c64707513a239c662e99739c04 /library/std/src/sys/wasi | |
| parent | cdbe2888979bb8797b05f0d58a6f6e60753983d2 (diff) | |
| download | rust-0b37bb2bc25be8059e88a4139d9ab067d9600610.tar.gz rust-0b37bb2bc25be8059e88a4139d9ab067d9600610.zip | |
Redefine `ErrorKind::Other` and stop using it in std.
Diffstat (limited to 'library/std/src/sys/wasi')
| -rw-r--r-- | library/std/src/sys/wasi/fs.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/wasi/mod.rs | 4 | 
2 files changed, 4 insertions, 4 deletions
| diff --git a/library/std/src/sys/wasi/fs.rs b/library/std/src/sys/wasi/fs.rs index 45e38f68b8c..75eaa8446a3 100644 --- a/library/std/src/sys/wasi/fs.rs +++ b/library/std/src/sys/wasi/fs.rs @@ -648,7 +648,7 @@ fn open_parent(p: &Path) -> io::Result<(ManuallyDrop<WasiFd>, PathBuf)> { through which {:?} could be opened", p ); - return Err(io::Error::new(io::ErrorKind::Other, msg)); + return Err(io::Error::new(io::ErrorKind::Unknown, msg)); } let relative = CStr::from_ptr(relative_path).to_bytes().to_vec(); @@ -670,7 +670,7 @@ fn open_parent(p: &Path) -> io::Result<(ManuallyDrop<WasiFd>, PathBuf)> { } pub fn osstr2str(f: &OsStr) -> io::Result<&str> { - f.to_str().ok_or_else(|| io::Error::new_const(io::ErrorKind::Other, &"input must be utf-8")) + f.to_str().ok_or_else(|| io::Error::new_const(io::ErrorKind::Unknown, &"input must be utf-8")) } pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { diff --git a/library/std/src/sys/wasi/mod.rs b/library/std/src/sys/wasi/mod.rs index 45a829c0cd2..17107213181 100644 --- a/library/std/src/sys/wasi/mod.rs +++ b/library/std/src/sys/wasi/mod.rs @@ -58,7 +58,7 @@ pub use common::*; pub fn decode_error_kind(errno: i32) -> std_io::ErrorKind { use std_io::ErrorKind::*; if errno > u16::MAX as i32 || errno < 0 { - return Other; + return Unknown; } match errno as u16 { wasi::ERRNO_CONNREFUSED => ConnectionRefused, @@ -77,7 +77,7 @@ pub fn decode_error_kind(errno: i32) -> std_io::ErrorKind { wasi::ERRNO_AGAIN => WouldBlock, wasi::ERRNO_NOSYS => Unsupported, wasi::ERRNO_NOMEM => OutOfMemory, - _ => Other, + _ => Unknown, } } | 
