diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2020-11-20 06:14:29 +0100 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2021-04-18 09:29:22 +0200 |
| commit | 4a15bd8eaff4f749113dc49bbcf877e34593726b (patch) | |
| tree | 195c4c072b579b9a2939b945a89a184219790d3e /library/std/src/sys | |
| parent | 9c3b66cff74f3a21dc735294f3df319a38bc2114 (diff) | |
| download | rust-4a15bd8eaff4f749113dc49bbcf877e34593726b.tar.gz rust-4a15bd8eaff4f749113dc49bbcf877e34593726b.zip | |
Add and insta-stabilize `std::io::ErrorKind::NotSupported`
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/unix/l4re.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unsupported/common.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unsupported/os.rs | 4 | ||||
| -rw-r--r-- | library/std/src/sys/windows/fs.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/windows/net.rs | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/library/std/src/sys/unix/l4re.rs b/library/std/src/sys/unix/l4re.rs index d60a4b5591f..6d2d1c5a84a 100644 --- a/library/std/src/sys/unix/l4re.rs +++ b/library/std/src/sys/unix/l4re.rs @@ -1,6 +1,6 @@ macro_rules! unimpl { () => { - return Err(io::Error::new_const(io::ErrorKind::Other, &"No networking available on L4Re.")); + return Err(io::Error::new_const(io::ErrorKind::NotSupported, &"No networking available on L4Re.")); }; } diff --git a/library/std/src/sys/unsupported/common.rs b/library/std/src/sys/unsupported/common.rs index 01e4fd3c994..9d18b83d563 100644 --- a/library/std/src/sys/unsupported/common.rs +++ b/library/std/src/sys/unsupported/common.rs @@ -18,7 +18,7 @@ pub fn unsupported<T>() -> std_io::Result<T> { } pub fn unsupported_err() -> std_io::Error { - std_io::Error::new_const(std_io::ErrorKind::Other, &"operation not supported on this platform") + std_io::Error::new_const(std_io::ErrorKind::NotSupported, &"operation not supported on this platform") } pub fn decode_error_kind(_code: i32) -> crate::io::ErrorKind { diff --git a/library/std/src/sys/unsupported/os.rs b/library/std/src/sys/unsupported/os.rs index 897927e7b79..bd94e2d629e 100644 --- a/library/std/src/sys/unsupported/os.rs +++ b/library/std/src/sys/unsupported/os.rs @@ -80,11 +80,11 @@ pub fn getenv(_: &OsStr) -> io::Result<Option<OsString>> { } pub fn setenv(_: &OsStr, _: &OsStr) -> io::Result<()> { - Err(io::Error::new_const(io::ErrorKind::Other, &"cannot set env vars on this platform")) + Err(io::Error::new_const(io::ErrorKind::NotSupported, &"cannot set env vars on this platform")) } pub fn unsetenv(_: &OsStr) -> io::Result<()> { - Err(io::Error::new_const(io::ErrorKind::Other, &"cannot unset env vars on this platform")) + Err(io::Error::new_const(io::ErrorKind::NotSupported, &"cannot unset env vars on this platform")) } pub fn temp_dir() -> PathBuf { diff --git a/library/std/src/sys/windows/fs.rs b/library/std/src/sys/windows/fs.rs index c6509db80c0..ef68405b103 100644 --- a/library/std/src/sys/windows/fs.rs +++ b/library/std/src/sys/windows/fs.rs @@ -802,7 +802,7 @@ pub fn link(original: &Path, link: &Path) -> io::Result<()> { #[cfg(target_vendor = "uwp")] pub fn link(_original: &Path, _link: &Path) -> io::Result<()> { - return Err(io::Error::new_const(io::ErrorKind::Other, &"hard link are not supported on UWP")); + return Err(io::Error::new_const(io::ErrorKind::NotSupported, &"hard link are not supported on UWP")); } pub fn stat(path: &Path) -> io::Result<FileAttr> { diff --git a/library/std/src/sys/windows/net.rs b/library/std/src/sys/windows/net.rs index e50adcb28a4..f6691ccd3e1 100644 --- a/library/std/src/sys/windows/net.rs +++ b/library/std/src/sys/windows/net.rs @@ -370,7 +370,7 @@ impl Socket { #[cfg(target_vendor = "uwp")] fn set_no_inherit(&self) -> io::Result<()> { - Err(io::Error::new_const(io::ErrorKind::Other, &"Unavailable on UWP")) + Err(io::Error::new_const(io::ErrorKind::NotSupported, &"Unavailable on UWP")) } pub fn shutdown(&self, how: Shutdown) -> io::Result<()> { |
